Saml2SecurityTokenHandler.ValidateToken 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.
Overloads
ValidateToken(String, TokenValidationParameters, SecurityToken) |
Reads and validates a Saml2SecurityToken. |
ValidateToken(XmlReader, TokenValidationParameters, SecurityToken) |
Reads and validates a Saml2SecurityToken. |
ValidateToken(String, TokenValidationParameters, SecurityToken)
Reads and validates a Saml2SecurityToken.
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
The Saml2 token.
- validationParameters
- TokenValidationParameters
The TokenValidationParameters to be used for validating the token.
- validatedToken
- SecurityToken
The Saml2SecurityToken that was validated.
Returns
A ClaimsPrincipal representing the identity contained in the token.
Exceptions
validationParameters
is null.
token
.Length is greater than MaximumTokenSizeInBytes.
if the token
is not well-formed.
if ValidateSignature(String, TokenValidationParameters) returns null.
Applies to
ValidateToken(XmlReader, TokenValidationParameters, SecurityToken)
Reads and validates a Saml2SecurityToken.
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
- validationParameters
- TokenValidationParameters
The TokenValidationParameters to be used for validating the token.
- validatedToken
- SecurityToken
The Saml2SecurityToken that was validated.
Returns
A ClaimsPrincipal representing the identity contained in the token.
Exceptions
if validationParameters
is null.
if the token is not well-formed.
if ReadAssertion(XmlReader) returns null.