Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

EndpointIdentity::CreateIdentity Method (Claim^)

 

Creates an identity with the specified claim.

Namespace:   System.ServiceModel
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public:
static EndpointIdentity^ CreateIdentity(
	Claim^ identity
)

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;
}

.NET Framework
Available since 3.0
Return to top
Show:
© 2017 Microsoft