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;
}
Aggregations