Search in sources :

Example 1 with FirebaseTokenValidator

use of org.springframework.cloud.gcp.security.firebase.FirebaseTokenValidator in project spring-cloud-gcp by spring-cloud.

the class FirebaseAuthenticationAutoConfiguration method firebaseJwtDelegatingValidator.

@Bean
@ConditionalOnMissingBean(name = "firebaseJwtDelegatingValidator")
public DelegatingOAuth2TokenValidator<Jwt> firebaseJwtDelegatingValidator(JwtIssuerValidator jwtIssuerValidator, GcpProjectIdProvider gcpProjectIdProvider) {
    List<OAuth2TokenValidator<Jwt>> validators = new ArrayList<>();
    validators.add(new JwtTimestampValidator());
    validators.add(jwtIssuerValidator);
    validators.add(new FirebaseTokenValidator(projectId));
    return new DelegatingOAuth2TokenValidator<>(validators);
}
Also used : FirebaseTokenValidator(org.springframework.cloud.gcp.security.firebase.FirebaseTokenValidator) DelegatingOAuth2TokenValidator(org.springframework.security.oauth2.core.DelegatingOAuth2TokenValidator) OAuth2TokenValidator(org.springframework.security.oauth2.core.OAuth2TokenValidator) ArrayList(java.util.ArrayList) JwtTimestampValidator(org.springframework.security.oauth2.jwt.JwtTimestampValidator) DelegatingOAuth2TokenValidator(org.springframework.security.oauth2.core.DelegatingOAuth2TokenValidator) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

ArrayList (java.util.ArrayList)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 FirebaseTokenValidator (org.springframework.cloud.gcp.security.firebase.FirebaseTokenValidator)1 Bean (org.springframework.context.annotation.Bean)1 DelegatingOAuth2TokenValidator (org.springframework.security.oauth2.core.DelegatingOAuth2TokenValidator)1 OAuth2TokenValidator (org.springframework.security.oauth2.core.OAuth2TokenValidator)1 JwtTimestampValidator (org.springframework.security.oauth2.jwt.JwtTimestampValidator)1