EndpointIdentity::CreateIdentity Method (Claim^)
Creates an identity with the specified claim.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
Parameters
- identity
-
Type:
System.IdentityModel.Claims::Claim^
A Claim used to create the new identity.
Return Value
Type: System.ServiceModel::EndpointIdentity^An EndpointIdentity associated with the specified identity.
| Exception | Condition |
|---|---|
| ArgumentNullException | identity is null. |
A secure WCF client that connects to an endpoint with this identity verifies that the claims presented by the server contain the identity claim used to construct this identity.
This method can create an identity of type DnsEndpointIdentity, SpnEndpointIdentity, UpnEndpointIdentity, or RsaEndpointIdentity.
The following code shows how to call this method.
// Utility function to create an EndpointIdentity from a ClaimSet. private EndpointIdentity CreateIdentityFromClaimSet(ClaimSet claims) { foreach (Claim claim in claims.FindClaims(null, Rights.Identity)) { return EndpointIdentity.CreateIdentity(claim); } return null; }
Available since 3.0