Search in sources :

Example 1 with CommonOAuth2Provider

use of org.springframework.security.config.oauth2.client.CommonOAuth2Provider in project spring-boot by spring-projects.

the class OAuth2ClientPropertiesRegistrationAdapter method getBuilder.

private static Builder getBuilder(String registrationId, String configuredProviderId, Map<String, Provider> providers) {
    String providerId = (configuredProviderId != null) ? configuredProviderId : registrationId;
    CommonOAuth2Provider provider = getCommonProvider(providerId);
    if (provider == null && !providers.containsKey(providerId)) {
        throw new IllegalStateException(getErrorMessage(configuredProviderId, registrationId));
    }
    Builder builder = (provider != null) ? provider.getBuilder(registrationId) : ClientRegistration.withRegistrationId(registrationId);
    if (providers.containsKey(providerId)) {
        return getBuilder(builder, providers.get(providerId));
    }
    return builder;
}
Also used : Builder(org.springframework.security.oauth2.client.registration.ClientRegistration.Builder) CommonOAuth2Provider(org.springframework.security.config.oauth2.client.CommonOAuth2Provider)

Aggregations

CommonOAuth2Provider (org.springframework.security.config.oauth2.client.CommonOAuth2Provider)1 Builder (org.springframework.security.oauth2.client.registration.ClientRegistration.Builder)1