EndpointIdentity.CreateIdentity(Claim) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates an identity with the specified claim.
public:
static System::ServiceModel::EndpointIdentity ^ CreateIdentity(System::IdentityModel::Claims::Claim ^ identity);
public static System.ServiceModel.EndpointIdentity CreateIdentity (System.IdentityModel.Claims.Claim identity);
static member CreateIdentity : System.IdentityModel.Claims.Claim -> System.ServiceModel.EndpointIdentity
Public Shared Function CreateIdentity (identity As Claim) As EndpointIdentity
Parameters
Returns
An EndpointIdentity associated with the specified identity
.
Exceptions
identity
is null
.
Examples
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;
}
Remarks
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.
Applies to
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour