TokenValidationParameters Class

  • java.lang.Object
    • com.microsoft.bot.connector.authentication.TokenValidationParameters

public class TokenValidationParameters

Contains a set of parameters that are used when validating a token.

Field Summary

Modifier and Type Field and Description
java.time.Duration clockSkew

Clock skew to apply when validating a time.

OpenIdMetadataResolver issuerSigningKeyResolver

Optional (and not recommended) Function to return OpenIdMetaData resolver for a given url.

boolean requireSignedTokens

Value indicating whether a token can be considered valid if not signed.

java.util.List<java.lang.String> validIssuers

Contains valid issuers that will be used to check against the token's issuer.

boolean validateAudience

Control if the audience will be validated during token validation.

boolean validateIssuer

Control if the issuer will be validated during token validation.

boolean validateIssuerSigningKey

True to validate the signing cert.

boolean validateLifetime

Control if the lifetime will be validated during token validation.

Constructor Summary

Constructor Description
TokenValidationParameters()

Default parameters.

TokenValidationParameters(boolean validateIssuer, List<String> validIssuers, boolean validateAudience, boolean validateLifetime, Duration clockSkew, boolean requireSignedTokens)
TokenValidationParameters(TokenValidationParameters other)

Copy constructor.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Field Details

clockSkew

public Duration clockSkew

Clock skew to apply when validating a time.

issuerSigningKeyResolver

public OpenIdMetadataResolver issuerSigningKeyResolver

Optional (and not recommended) Function to return OpenIdMetaData resolver for a given url.

requireSignedTokens

public boolean requireSignedTokens

Value indicating whether a token can be considered valid if not signed.

validIssuers

public List validIssuers

Contains valid issuers that will be used to check against the token's issuer.

validateAudience

public boolean validateAudience

Control if the audience will be validated during token validation.

validateIssuer

public boolean validateIssuer

Control if the issuer will be validated during token validation.

validateIssuerSigningKey

public boolean validateIssuerSigningKey

True to validate the signing cert.

validateLifetime

public boolean validateLifetime

Control if the lifetime will be validated during token validation.

Constructor Details

TokenValidationParameters

public TokenValidationParameters()

Default parameters.

TokenValidationParameters

public TokenValidationParameters(boolean validateIssuer, List validIssuers, boolean validateAudience, boolean validateLifetime, Duration clockSkew, boolean requireSignedTokens)

Parameters:

validateIssuer - Control if the issuer will be validated during token validation.
validIssuers - Contains valid issuers that will be used to check against the token's issuer.
validateAudience - Control if the audience will be validated during token validation.
validateLifetime - Control if the lifetime will be validated during token validation.
clockSkew - Clock skew to apply when validating a time.
requireSignedTokens - Value indicating whether a token can be considered valid if not signed.

TokenValidationParameters

public TokenValidationParameters(TokenValidationParameters other)

Copy constructor.

Parameters:

other - The TokenValidationParameters to copy.

Applies to