Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class Microsoft.​IdentityModel.​Tokens.​Validators

Assembly: Microsoft.IdentityModel.Tokens

Inheritance: object → Validators

Partial class for Audience Validation.

Methods

public static void
ValidateAlgorithm​(string algorithm, SecurityKey securityKey, SecurityToken securityToken, TokenValidationParameters validationParameters)
Validates if a given algorithm for a <see cref="T:Microsoft.IdentityModel.Tokens.SecurityKey" /> is valid.
algorithm The algorithm to be validated.
securityKey The <see cref="T:Microsoft.IdentityModel.Tokens.SecurityKey" /> that signed the <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> .
securityToken The <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> being validated.
validationParameters <see cref="T:Microsoft.IdentityModel.Tokens.TokenValidationParameters" /> required for validation.
public static void
ValidateAudience​(System.​Collections.​Generic.​IEnumerable<​string> audiences, SecurityToken securityToken, TokenValidationParameters validationParameters)
Determines if the audiences found in a <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> are valid.
audiences The audiences found in the <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> .
securityToken The <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> being validated.
validationParameters <see cref="T:Microsoft.IdentityModel.Tokens.TokenValidationParameters" /> required for validation.
Remarks An EXACT match is required.
public static string
ValidateIssuer​(string issuer, SecurityToken securityToken, TokenValidationParameters validationParameters)
Determines if an issuer found in a <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> is valid.
Returns The issuer to use when creating the "Claim"(s) in a "ClaimsIdentity".
issuer The issuer to validate
securityToken The <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> that is being validated.
validationParameters <see cref="T:Microsoft.IdentityModel.Tokens.TokenValidationParameters" /> required for validation.
Remarks An EXACT match is required.
public static void
ValidateIssuerSecurityKey​(SecurityKey securityKey, SecurityToken securityToken, TokenValidationParameters validationParameters)
Validates the <see cref="T:Microsoft.IdentityModel.Tokens.SecurityKey" /> that signed a <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> .
securityKey The <see cref="T:Microsoft.IdentityModel.Tokens.SecurityKey" /> that signed the <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> .
securityToken The <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> being validated.
validationParameters <see cref="T:Microsoft.IdentityModel.Tokens.TokenValidationParameters" /> required for validation.
public static void
ValidateLifetime​(System.​DateTime? notBefore, System.​DateTime? expires, SecurityToken securityToken, TokenValidationParameters validationParameters)
Validates the lifetime of a <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> .
notBefore The 'notBefore' time found in the <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> .
expires The 'expiration' time found in the <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> .
securityToken The <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> being validated.
validationParameters <see cref="T:Microsoft.IdentityModel.Tokens.TokenValidationParameters" /> required for validation.
Remarks All time comparisons apply <see cref="P:Microsoft.IdentityModel.Tokens.TokenValidationParameters.ClockSkew" /> .
public static void
ValidateTokenReplay​(System.​DateTime? expirationTime, string securityToken, TokenValidationParameters validationParameters)
Validates if a token has been replayed.
expirationTime When does the security token expire.
securityToken The <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> being validated.
validationParameters <see cref="T:Microsoft.IdentityModel.Tokens.TokenValidationParameters" /> required for validation.
public static void
ValidateTokenReplay​(string securityToken, System.​DateTime? expirationTime, TokenValidationParameters validationParameters)
Validates if a token has been replayed.
securityToken The <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> being validated.
expirationTime When does the security token expire.
validationParameters <see cref="T:Microsoft.IdentityModel.Tokens.TokenValidationParameters" /> required for validation.
public static string
ValidateTokenType​(string type, SecurityToken securityToken, TokenValidationParameters validationParameters)
Validates the type of the token.
Returns The actual token type, that may be the same as <paramref name="type" /> or a different value if the token type was resolved from a different location.
type The token type or <c>null</c> if it couldn't be resolved (e.g from the 'typ' header for a JWT).
securityToken The <see cref="T:Microsoft.IdentityModel.Tokens.SecurityToken" /> that is being validated.
validationParameters <see cref="T:Microsoft.IdentityModel.Tokens.TokenValidationParameters" /> required for validation.
Remarks An EXACT match is required. <see cref="F:System.StringComparison.Ordinal" /> (case sensitive) is used for comparing <paramref name="type" /> against <see cref="P:Microsoft.IdentityModel.Tokens.TokenValidationParameters.ValidTypes" /> .
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object