다음을 통해 공유


AadIssuerValidator.Validate Method

Definition

Validate the issuer for single and multi-tenant applications of various audiences (Work and School accounts, or Work and School accounts + Personal accounts) and the various clouds.

public string Validate (string issuer, Microsoft.IdentityModel.Tokens.SecurityToken securityToken, Microsoft.IdentityModel.Tokens.TokenValidationParameters validationParameters);
member this.Validate : string * Microsoft.IdentityModel.Tokens.SecurityToken * Microsoft.IdentityModel.Tokens.TokenValidationParameters -> string
Public Function Validate (issuer As String, securityToken As SecurityToken, validationParameters As TokenValidationParameters) As String

Parameters

issuer
String

Issuer to validate (will be tenanted).

securityToken
SecurityToken

Received security token.

validationParameters
TokenValidationParameters

The TokenValidationParameters to be used for validating the token.

Returns

The issuer if it's valid, or otherwise SecurityTokenInvalidIssuerException is thrown.

Exceptions

if validationParameters is null.

if the issuer is invalid or if there is a network issue.

Examples

AadIssuerValidator aadIssuerValidator = AadIssuerValidator.GetAadIssuerValidator(authority, httpClient);
TokenValidationParameters.IssuerValidator = aadIssuerValidator.Validate;

Remarks

The issuer is considered as valid if it has the same HTTP scheme and authority as the authority from the configuration file, has a tenant ID, and optionally v2.0 (if this web API accepts both V1 and V2 tokens).

Applies to