C# Class Thinktecture.IdentityModel.Extensions.SecurityTokensExtensions

Extension methods to convert tokens to string and claims
ファイルを表示 Open project: IdentityModel/Thinktecture.IdentityModel.v1

Public Methods

Method Description
ToClaimsPrincipal ( this token, SecurityTokenHandlerCollection handler ) : IClaimsPrincipal

Converts a SecurityToken to an IClaimsPrincipal.

ToClaimsPrincipal ( this token, X509Certificate2 signingCertificate ) : IClaimsPrincipal

Converts a SecurityToken to an IClaimsPrincipal.

ToClaimsPrincipal ( this token, X509Certificate2 signingCertificate, string audienceUri ) : IClaimsPrincipal

Converts a SecurityToken to an IClaimsPrincipal.

ToClaimsPrincipal ( this token, string thumbprint ) : IClaimsPrincipal

Converts a SecurityToken to an IClaimsPrincipal.

ToSecurityToken ( this token ) : System.IdentityModel.Tokens.SecurityToken

Turns a supported generic XML security token to a security token.

ToSecurityToken ( this token, SecurityTokenHandlerCollection handler ) : System.IdentityModel.Tokens.SecurityToken

Turns a supported generic XML security token to a security token.

ToSecurityToken ( this token, X509Certificate2 decryptionCertificate ) : System.IdentityModel.Tokens.SecurityToken

Turns a supported generic XML security token to a security token.

ToTokenXmlString ( this token ) : string

Retrieves the XML from a GenericXmlSecurityToken

ToTokenXmlString ( this token, SecurityTokenHandlerCollection handler ) : string

Converts a supported token to an XML string.

Private Methods

Method Description
CreateDefaultHandlerCollection ( this configuration ) : SecurityTokenHandlerCollection
CreateIssuerNameRegistry ( this certificate ) : System.IdentityModel.Tokens.IssuerNameRegistry
CreateSecurityTokenResolver ( this certificate ) : System.IdentityModel.Selectors.SecurityTokenResolver
CreateStandardConfiguration ( X509Certificate2 signingCertificate ) : System.IdentityModel.Tokens.SecurityTokenHandlerConfiguration
CreateStandardConfiguration ( string thumbprint ) : System.IdentityModel.Tokens.SecurityTokenHandlerConfiguration

Method Details

ToClaimsPrincipal() public static method

Converts a SecurityToken to an IClaimsPrincipal.
public static ToClaimsPrincipal ( this token, SecurityTokenHandlerCollection handler ) : IClaimsPrincipal
token this The token.
handler SecurityTokenHandlerCollection The handler.
return IClaimsPrincipal

ToClaimsPrincipal() public static method

Converts a SecurityToken to an IClaimsPrincipal.
public static ToClaimsPrincipal ( this token, X509Certificate2 signingCertificate ) : IClaimsPrincipal
token this The token.
signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2 The signing certificate.
return IClaimsPrincipal

ToClaimsPrincipal() public static method

Converts a SecurityToken to an IClaimsPrincipal.
public static ToClaimsPrincipal ( this token, X509Certificate2 signingCertificate, string audienceUri ) : IClaimsPrincipal
token this The token.
signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2 The signing certificate.
audienceUri string The audience URI.
return IClaimsPrincipal

ToClaimsPrincipal() public static method

Converts a SecurityToken to an IClaimsPrincipal.
public static ToClaimsPrincipal ( this token, string thumbprint ) : IClaimsPrincipal
token this The token.
thumbprint string The signing certificate thumbprint
return IClaimsPrincipal

ToSecurityToken() public static method

Turns a supported generic XML security token to a security token.
public static ToSecurityToken ( this token ) : System.IdentityModel.Tokens.SecurityToken
token this The generic XML security token.
return System.IdentityModel.Tokens.SecurityToken

ToSecurityToken() public static method

Turns a supported generic XML security token to a security token.
public static ToSecurityToken ( this token, SecurityTokenHandlerCollection handler ) : System.IdentityModel.Tokens.SecurityToken
token this The generic XML security token.
handler SecurityTokenHandlerCollection The security token handler.
return System.IdentityModel.Tokens.SecurityToken

ToSecurityToken() public static method

Turns a supported generic XML security token to a security token.
public static ToSecurityToken ( this token, X509Certificate2 decryptionCertificate ) : System.IdentityModel.Tokens.SecurityToken
token this The token.
decryptionCertificate System.Security.Cryptography.X509Certificates.X509Certificate2 The decryption certificate.
return System.IdentityModel.Tokens.SecurityToken

ToTokenXmlString() public static method

Retrieves the XML from a GenericXmlSecurityToken
public static ToTokenXmlString ( this token ) : string
token this The token.
return string

ToTokenXmlString() public static method

Converts a supported token to an XML string.
public static ToTokenXmlString ( this token, SecurityTokenHandlerCollection handler ) : string
token this The token.
handler SecurityTokenHandlerCollection The token handler.
return string