Java 类org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerEndpointsConfiguration 实例源码

项目:spring-security-oauth2-boot    文件:ResourceServerProperties.java   
@PostConstruct
public void validate() {
    if (countBeans(AuthorizationServerEndpointsConfiguration.class) > 0) {
        // If we are an authorization server we don't need remote resource token
        // services
        return;
    }
    if (countBeans(ResourceServerTokenServicesConfiguration.class) == 0) {
        // If we are not a resource server or an SSO client we don't need remote
        // resource token services
        return;
    }
    if (!StringUtils.hasText(this.clientId)) {
        return;
    }
    try {
        doValidate();
    }
    catch (BindException ex) {
        throw new IllegalStateException(ex);
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ResourceServerProperties.java   
@Override
public void validate(Object target, Errors errors) {
    if (countBeans(AuthorizationServerEndpointsConfiguration.class) > 0) {
        // If we are an authorization server we don't need remote resource token
        // services
        return;
    }
    if (countBeans(ResourceServerTokenServicesConfiguration.class) == 0) {
        // If we are not a resource server or an SSO client we don't need remote
        // resource token services
        return;
    }
    ResourceServerProperties resource = (ResourceServerProperties) target;
    if (StringUtils.hasText(this.clientId)) {
        if (!StringUtils.hasText(this.clientSecret)) {
            if (!StringUtils.hasText(resource.getUserInfoUri())) {
                errors.rejectValue("userInfoUri", "missing.userInfoUri",
                        "Missing userInfoUri (no client secret available)");
            }
        }
        else {
            if (isPreferTokenInfo()
                    && !StringUtils.hasText(resource.getTokenInfoUri())) {
                if (StringUtils.hasText(getJwt().getKeyUri())
                        || StringUtils.hasText(getJwt().getKeyValue())) {
                    // It's a JWT decoder
                    return;
                }
                if (!StringUtils.hasText(resource.getUserInfoUri())) {
                    errors.rejectValue("tokenInfoUri", "missing.tokenInfoUri",
                            "Missing tokenInfoUri and userInfoUri and there is no "
                                    + "JWT verifier key");
                }
            }
        }
    }
}
项目:spring-boot-concourse    文件:ResourceServerProperties.java   
@Override
public void validate(Object target, Errors errors) {
    if (countBeans(AuthorizationServerEndpointsConfiguration.class) > 0) {
        // If we are an authorization server we don't need remote resource token
        // services
        return;
    }
    if (countBeans(ResourceServerTokenServicesConfiguration.class) == 0) {
        // If we are not a resource server or an SSO client we don't need remote
        // resource token services
        return;
    }
    ResourceServerProperties resource = (ResourceServerProperties) target;
    if (StringUtils.hasText(this.clientId)) {
        if (!StringUtils.hasText(this.clientSecret)) {
            if (!StringUtils.hasText(resource.getUserInfoUri())) {
                errors.rejectValue("userInfoUri", "missing.userInfoUri",
                        "Missing userInfoUri (no client secret available)");
            }
        }
        else {
            if (isPreferTokenInfo()
                    && !StringUtils.hasText(resource.getTokenInfoUri())) {
                if (StringUtils.hasText(getJwt().getKeyUri())
                        || StringUtils.hasText(getJwt().getKeyValue())) {
                    // It's a JWT decoder
                    return;
                }
                if (!StringUtils.hasText(resource.getUserInfoUri())) {
                    errors.rejectValue("tokenInfoUri", "missing.tokenInfoUri",
                            "Missing tokenInfoUri and userInfoUri and there is no "
                                    + "JWT verifier key");
                }
            }
        }
    }
}
项目:contestparser    文件:ResourceServerProperties.java   
@Override
public void validate(Object target, Errors errors) {
    if (countBeans(AuthorizationServerEndpointsConfiguration.class) > 0) {
        // If we are an authorization server we don't need remote resource token
        // services
        return;
    }
    if (countBeans(ResourceServerTokenServicesConfiguration.class) == 0) {
        // If we are not a resource server or an SSO client we don't need remote
        // resource token services
        return;
    }
    ResourceServerProperties resource = (ResourceServerProperties) target;
    if (StringUtils.hasText(this.clientId)) {
        if (!StringUtils.hasText(this.clientSecret)) {
            if (!StringUtils.hasText(resource.getUserInfoUri())) {
                errors.rejectValue("userInfoUri", "missing.userInfoUri",
                        "Missing userInfoUri (no client secret available)");
            }
        }
        else {
            if (isPreferTokenInfo()
                    && !StringUtils.hasText(resource.getTokenInfoUri())) {
                if (StringUtils.hasText(getJwt().getKeyUri())
                        || StringUtils.hasText(getJwt().getKeyValue())) {
                    // It's a JWT decoder
                    return;
                }
                if (!StringUtils.hasText(resource.getUserInfoUri())) {
                    errors.rejectValue("tokenInfoUri", "missing.tokenInfoUri",
                            "Missing tokenInfoUri and userInfoUri and there is no "
                                    + "JWT verifier key");
                }
            }
        }
    }
}