SamlSecurityTokenHandler.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 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
- 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.
if ReadSamlToken(XmlReader) returns null."