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
ConstructorDescriptionDefaultClientRegistrationPropertiesService
(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> SinceClientRegistration
is a final class,ModelMapper
complains about adding mappings viaTypeMap
.protected org.modelmapper.ModelMapper
Get anOAuthClientRegistrationWrapper
that is defined in application properties.getAll()
Get allOAuthClientRegistrationWrapper
objects that are defined in application properties.Map of ClientRegistrations defined via application properties The key is set fromClientRegistration.getRegistrationId()
protected org.modelmapper.ModelMapper
Extension point for those who extendOAuthClientRegistrationWrapper
.wrapClientRegistration
(@NonNull org.springframework.security.oauth2.client.registration.ClientRegistration clientRegistration) Converts aClientRegistration
to 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()SinceClientRegistration
is a final class,ModelMapper
complains 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 fromClientRegistration
togetWrapperType()
-
get
Description copied from interface:ClientRegistrationPropertiesService
Get anOAuthClientRegistrationWrapper
that is defined in application properties.- Specified by:
get
in interfaceClientRegistrationPropertiesService<P extends OAuthClientRegistrationWrapper>
- Returns:
-
getAll
Description copied from interface:ClientRegistrationPropertiesService
Get allOAuthClientRegistrationWrapper
objects that are defined in application properties.- Specified by:
getAll
in interfaceClientRegistrationPropertiesService<P extends OAuthClientRegistrationWrapper>
- Returns:
-
wrapClientRegistration
public P wrapClientRegistration(@NonNull @NonNull org.springframework.security.oauth2.client.registration.ClientRegistration clientRegistration) Description copied from interface:ClientRegistrationPropertiesService
Converts aClientRegistration
to aOAuthClientRegistrationWrapper
.- Specified by:
wrapClientRegistration
in interfaceClientRegistrationPropertiesService<P extends OAuthClientRegistrationWrapper>
- Returns:
- OAuthClientRegistrationWrapper
-
getWrapperType
Extension point for those who extendOAuthClientRegistrationWrapper
.- Returns:
- The type of
OAuthClientRegistrationWrapper
to 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()
-