Class DefaultClientRegistrationPropertiesService<P extends OAuthClientRegistrationWrapper>
java.lang.Object
com.broadleafcommerce.auth.client.registration.DefaultClientRegistrationPropertiesService<P>
- All Implemented Interfaces:
ClientRegistrationPropertiesService<P>
public class DefaultClientRegistrationPropertiesService<P extends OAuthClientRegistrationWrapper>
extends Object
implements ClientRegistrationPropertiesService<P>
This service provides
OAuthClientRegistrationWrapper objects built from
OAuth2ClientProperties defined through application properties. All methods of this class
will gracefully return null if the OAuth2ClientProperties properties are not set.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultClientRegistrationPropertiesService(org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientProperties oAuth2ClientProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.modelmapper.Converter<org.springframework.security.oauth2.client.registration.ClientRegistration,P> SinceClientRegistrationis a final class,ModelMappercomplains about adding mappings viaTypeMap.protected org.modelmapper.ModelMapperGet anOAuthClientRegistrationWrapperthat is defined in application properties.getAll()Get allOAuthClientRegistrationWrapperobjects that are defined in application properties.Map of ClientRegistrations defined via application properties The key is set fromClientRegistration.getRegistrationId()protected org.modelmapper.ModelMapperExtension point for those who extendOAuthClientRegistrationWrapper.wrapClientRegistration(@NonNull org.springframework.security.oauth2.client.registration.ClientRegistration clientRegistration) Converts aClientRegistrationto aOAuthClientRegistrationWrapper.
-
Constructor Details
-
DefaultClientRegistrationPropertiesService
public DefaultClientRegistrationPropertiesService(@Nullable org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientProperties oAuth2ClientProperties)
-
-
Method Details
-
buildClientRegistrationWrapperMapper
protected org.modelmapper.ModelMapper buildClientRegistrationWrapperMapper() -
buildClientRegistrationToWrapperPostConverter
protected org.modelmapper.Converter<org.springframework.security.oauth2.client.registration.ClientRegistration,P> buildClientRegistrationToWrapperPostConverter()SinceClientRegistrationis a final class,ModelMappercomplains about adding mappings viaTypeMap. Thus, we need to explicitly apply any custom mapping logic against real instances.- Returns:
- a
TypeMap.setPostConverter(Converter)that can be used when mapping fromClientRegistrationtogetWrapperType()
-
get
Description copied from interface:ClientRegistrationPropertiesServiceGet anOAuthClientRegistrationWrapperthat is defined in application properties.- Specified by:
getin interfaceClientRegistrationPropertiesService<P extends OAuthClientRegistrationWrapper>- Returns:
-
getAll
Description copied from interface:ClientRegistrationPropertiesServiceGet allOAuthClientRegistrationWrapperobjects that are defined in application properties.- Specified by:
getAllin interfaceClientRegistrationPropertiesService<P extends OAuthClientRegistrationWrapper>- Returns:
-
wrapClientRegistration
public P wrapClientRegistration(@NonNull @NonNull org.springframework.security.oauth2.client.registration.ClientRegistration clientRegistration) Description copied from interface:ClientRegistrationPropertiesServiceConverts aClientRegistrationto aOAuthClientRegistrationWrapper.- Specified by:
wrapClientRegistrationin interfaceClientRegistrationPropertiesService<P extends OAuthClientRegistrationWrapper>- Returns:
- OAuthClientRegistrationWrapper
-
getWrapperType
Extension point for those who extendOAuthClientRegistrationWrapper.- Returns:
- The type of
OAuthClientRegistrationWrapperto use as a wrapper forClientRegistration.
-
getClientRegistrations
protected Map<String,org.springframework.security.oauth2.client.registration.ClientRegistration> getClientRegistrations()Map of ClientRegistrations defined via application properties The key is set fromClientRegistration.getRegistrationId() -
getClientRegistrationWrapperMapper
protected org.modelmapper.ModelMapper getClientRegistrationWrapperMapper()
-