Example usage for org.springframework.security.oauth2.core OAuth2TokenValidatorResult success

List of usage examples for org.springframework.security.oauth2.core OAuth2TokenValidatorResult success

Introduction

In this page you can find the example usage for org.springframework.security.oauth2.core OAuth2TokenValidatorResult success.

Prototype

public static OAuth2TokenValidatorResult success() 

Source Link

Document

Construct a successful OAuth2TokenValidatorResult

Usage

From source file:org.springframework.cloud.gcp.security.iap.AudienceValidator.java

@Override
public OAuth2TokenValidatorResult validate(Jwt t) {
    if (t.getAudience() != null && t.getAudience().contains(this.audience)) {
        return OAuth2TokenValidatorResult.success();
    } else {//from  www  .  j  ava 2  s  .com
        if (LOGGER.isWarnEnabled()) {
            LOGGER.warn(String.format("Expected audience %s did not match token audience %s", this.audience,
                    t.getAudience()));
        }
        return OAuth2TokenValidatorResult.failure(INVALID_AUDIENCE);
    }
}