Freigeben über


SamlSecurityTokenHandler.ValidateToken Method

Definition

Overloads

ValidateToken(String, TokenValidationParameters, SecurityToken)

Reads and validates a well formed SamlSecurityToken.

ValidateToken(XmlReader, TokenValidationParameters, SecurityToken)

Reads and validates a well formed SamlSecurityToken.

ValidateToken(String, TokenValidationParameters, SecurityToken)

Reads and validates a well formed SamlSecurityToken.

public override System.Security.Claims.ClaimsPrincipal ValidateToken (string token, Microsoft.IdentityModel.Tokens.TokenValidationParameters validationParameters, out Microsoft.IdentityModel.Tokens.SecurityToken validatedToken);
override this.ValidateToken : string * Microsoft.IdentityModel.Tokens.TokenValidationParameters * SecurityToken -> System.Security.Claims.ClaimsPrincipal
Public Overrides Function ValidateToken (token As String, validationParameters As TokenValidationParameters, ByRef validatedToken As SecurityToken) As ClaimsPrincipal

Parameters

token
String

A string containing a well formed securityToken.

validationParameters
TokenValidationParameters

The TokenValidationParameters to be used for validating the token.

validatedToken
SecurityToken

The SecurityToken that was validated.

Returns

A ClaimsPrincipal generated from the claims in the Saml securityToken.

Exceptions

if validationParameters is null.

if 'securityToken.Length' is greater than MaximumTokenSizeInBytes.

Applies to

ValidateToken(XmlReader, TokenValidationParameters, SecurityToken)

Reads and validates a well formed SamlSecurityToken.

public override System.Security.Claims.ClaimsPrincipal ValidateToken (System.Xml.XmlReader reader, Microsoft.IdentityModel.Tokens.TokenValidationParameters validationParameters, out Microsoft.IdentityModel.Tokens.SecurityToken validatedToken);
override this.ValidateToken : System.Xml.XmlReader * Microsoft.IdentityModel.Tokens.TokenValidationParameters * SecurityToken -> System.Security.Claims.ClaimsPrincipal
Public Overrides Function ValidateToken (reader As XmlReader, validationParameters As TokenValidationParameters, ByRef validatedToken As SecurityToken) As ClaimsPrincipal

Parameters

reader
XmlReader

A XmlReader reader positioned at a saml assertion element.

validationParameters
TokenValidationParameters

The TokenValidationParameters to be used for validating the token.

validatedToken
SecurityToken

The SecurityToken that was validated.

Returns

A ClaimsPrincipal generated from the claims in the saml assertion.

Exceptions

if validationParameters is null.

Applies to