<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.19.1" />

Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolValidator

OpenIdConnectProtocolValidator is used to ensure that an OpenIdConnectMessage obtained using OpenID Connect is compliant with .
public static readonly TimeSpan DefaultNonceLifetime

Default for the how long the nonce is valid.

public static bool RequireSubByDefault { get; set; }

Gets or sets a value for default RequreSub.

public CryptoProviderFactory CryptoProviderFactory { get; set; }

Gets or sets the CryptoProviderFactory that will be used for crypto operations.

public IDictionary<string, string> HashAlgorithmMap { get; }

Gets the algorithm mapping between OpenIdConnect and .Net for Hash algorithms. a IDictionary<T, U> that contains mappings from the JWT namespace to .NET.

public IdTokenValidator IdTokenValidator { get; set; }

Gets or sets the delegate for validating 'id_token'.

public TimeSpan NonceLifetime { get; set; }

Gets or set the TimeSpan defining how long a nonce is valid.

public bool RequireAcr { get; set; }

Gets or sets a value indicating if an 'acr' claim is required.

public bool RequireAmr { get; set; }

Gets or sets a value indicating if an 'amr' claim is required.

public bool RequireAuthTime { get; set; }

Gets or sets a value indicating if an 'auth_time' claim is required.

public bool RequireAzp { get; set; }

Gets or sets a value indicating if an 'azp' claim is required.

public bool RequireNonce { get; set; }

Get or sets if a nonce is required.

public bool RequireState { get; set; }

Gets or sets a value indicating if a 'state' is required.

public bool RequireStateValidation { get; set; }

Gets or sets a value indicating if validation of 'state' is turned on or off.

public bool RequireSub { get; set; }

Gets or sets a value indicating if a 'sub' claim is required.

public bool RequireTimeStampInNonce { get; set; }

Gets or set logic to control if a nonce is prefixed with a timestamp.

Creates a new instance of OpenIdConnectProtocolValidator,

public virtual string GenerateNonce()

Generates a value suitable to use as a nonce.

public virtual HashAlgorithm GetHashAlgorithm(string algorithm)

Returns a HashAlgorithm corresponding to string 'algorithm' after translation using HashAlgorithmMap.

protected virtual void ValidateAtHash(OpenIdConnectProtocolValidationContext validationContext)

Validates the 'token' according to .

Validates that an OpenID Connect response from 'authorization_endpoint" is valid as per .

protected virtual void ValidateCHash(OpenIdConnectProtocolValidationContext validationContext)

Validates the 'code' according to .

protected virtual void ValidateIdToken(OpenIdConnectProtocolValidationContext validationContext)

Validates the claims in the 'id_token' as per .

protected virtual void ValidateNonce(OpenIdConnectProtocolValidationContext validationContext)

Validates that the JwtSecurityToken contains the nonce.

protected virtual void ValidateState(OpenIdConnectProtocolValidationContext validationContext)

Validates that the 'state' in message is valid.

public virtual void ValidateTokenResponse(OpenIdConnectProtocolValidationContext validationContext)

Validates that an OpenID Connect response from "token_endpoint" is valid as per .

Validates that an OpenIdConnect response from "userinfo_endpoint" is valid as per .