Example usage for org.springframework.security.oauth2.jwt JwtTimestampValidator JwtTimestampValidator

List of usage examples for org.springframework.security.oauth2.jwt JwtTimestampValidator JwtTimestampValidator

Introduction

In this page you can find the example usage for org.springframework.security.oauth2.jwt JwtTimestampValidator JwtTimestampValidator.

Prototype

public JwtTimestampValidator() 

Source Link

Document

A basic instance with no custom verification and the default max clock skew

Usage

From source file:org.springframework.cloud.gcp.autoconfigure.security.IapAuthenticationAutoConfiguration.java

@Bean
@ConditionalOnMissingBean(name = "iapJwtDelegatingValidator")
public DelegatingOAuth2TokenValidator<Jwt> iapJwtDelegatingValidator(IapAuthenticationProperties properties,
        AudienceValidator audienceValidator) {

    List<OAuth2TokenValidator<Jwt>> validators = new ArrayList<>();
    validators.add(new JwtTimestampValidator());
    validators.add(new JwtIssuerValidator(properties.getIssuer()));
    validators.add(audienceValidator);/*w w  w .  j ava  2 s  . c  om*/

    if (LOGGER.isInfoEnabled()) {
        LOGGER.info("Audience configured for IAP JWT validation: " + audienceValidator.getAudience());
    }

    return new DelegatingOAuth2TokenValidator<>(validators);
}