Class DefaultAuthServerCreationHandler
java.lang.Object
com.broadleafcommerce.auth.tenant.service.DefaultAuthServerCreationHandler
- All Implemented Interfaces:
AuthServerCreationHandler
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultAuthServerCreationHandler
(AuthorizationServerService<AuthorizationServer> serverService, AuthorizedClientService<AuthorizedClient> clientService, DefaultAuthServerProperties defaultAuthServerProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
applicationAlreadyHasClient
(Application application) protected String
buildRedirectUri
(String defaultRedirectUri, String templateVariableName, @NonNull Application application) buildRedirectUris
(@NonNull Set<String> defaultRedirectUris, String templateVariableName, @NonNull Application application) protected AuthorizationServer
createAuthorizationServer
(Application application, DefaultAuthServerProperties.AuthServerProperties properties, String friendlyName) protected void
createAuthorizedClient
(Application application, AuthorizationServer authorizationServer, DefaultAuthServerProperties.AuthServerProperties properties, String friendlyName) protected AuthorizationServer
createNewAuthServer
(Application application, DefaultAuthServerProperties.AuthServerProperties properties, String friendlyName) protected AuthorizedClientService<AuthorizedClient>
protected DefaultAuthServerProperties
protected Set<UserPermissionRef>
getDefaultPermissions
(DefaultAuthServerProperties.AuthServerProperties defaultAuthServerProperties) protected String
getDefaultRedirectUri
(Application application, DefaultAuthServerProperties.AuthServerProperties properties) protected Set<UserRoleRef>
getDefaultUserRoles
(DefaultAuthServerProperties.AuthServerProperties defaultAuthServerProperties) protected String
getFormattedIdentifier
(@NonNull Application application) Formats the identifier as all lowercase ifApplication.getIdentifierType()
isResolutionIdentifierType.DOMAIN
orResolutionIdentifierType.DOMAIN_PREFIX
since domains are case-insensitive but Spring does not treat them as such.getRedirectUris
(DefaultAuthServerProperties.AuthServerProperties properties, @NonNull Application application) protected String
protected AuthorizationServerService<AuthorizationServer>
protected com.broadleafcommerce.common.extension.TypeFactory
void
handleAuthServerCreation
(Application application, String friendlyName) Creates necessary authorization servers and clients when a new application is created.protected boolean
isContextPathResolution
(Application application) protected boolean
isDomainPrefixResolution
(Application application) protected boolean
isDomainResolution
(Application application) protected boolean
isParameterResolution
(Application application)
-
Field Details
-
DEFAULT_GRANT_TYPE
-
DEFAULT_AUTH_METHOD
-
-
Constructor Details
-
DefaultAuthServerCreationHandler
public DefaultAuthServerCreationHandler(AuthorizationServerService<AuthorizationServer> serverService, AuthorizedClientService<AuthorizedClient> clientService, DefaultAuthServerProperties defaultAuthServerProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
handleAuthServerCreation
Description copied from interface:AuthServerCreationHandler
Creates necessary authorization servers and clients when a new application is created.- Specified by:
handleAuthServerCreation
in interfaceAuthServerCreationHandler
- Parameters:
application
- The newly created applicationfriendlyName
- The user readable name to be used when creating the auth server and client.
-
applicationAlreadyHasClient
-
createAuthorizedClient
protected void createAuthorizedClient(Application application, AuthorizationServer authorizationServer, DefaultAuthServerProperties.AuthServerProperties properties, String friendlyName) -
getResetPasswordBaseUri
protected String getResetPasswordBaseUri(DefaultAuthServerProperties.AuthServerProperties properties) -
getGrantTypes
-
getAuthenticationMethods
protected Set<String> getAuthenticationMethods(DefaultAuthServerProperties.AuthServerProperties properties) -
getDefaultRedirectUri
protected String getDefaultRedirectUri(Application application, DefaultAuthServerProperties.AuthServerProperties properties) -
getRedirectUris
protected Set<String> getRedirectUris(@NonNull DefaultAuthServerProperties.AuthServerProperties properties, @NonNull @NonNull Application application) -
buildRedirectUris
-
buildRedirectUri
@Nullable protected String buildRedirectUri(@Nullable String defaultRedirectUri, String templateVariableName, @NonNull @NonNull Application application) -
getFormattedIdentifier
Formats the identifier as all lowercase ifApplication.getIdentifierType()
isResolutionIdentifierType.DOMAIN
orResolutionIdentifierType.DOMAIN_PREFIX
since domains are case-insensitive but Spring does not treat them as such.- Parameters:
application
- The application that was created.- Returns:
- The formatted identifier value
-
createAuthorizationServer
protected AuthorizationServer createAuthorizationServer(Application application, DefaultAuthServerProperties.AuthServerProperties properties, String friendlyName) -
createNewAuthServer
protected AuthorizationServer createNewAuthServer(Application application, DefaultAuthServerProperties.AuthServerProperties properties, String friendlyName) -
getDefaultPermissions
protected Set<UserPermissionRef> getDefaultPermissions(DefaultAuthServerProperties.AuthServerProperties defaultAuthServerProperties) -
getDefaultUserRoles
protected Set<UserRoleRef> getDefaultUserRoles(DefaultAuthServerProperties.AuthServerProperties defaultAuthServerProperties) -
isDomainPrefixResolution
-
isParameterResolution
-
isContextPathResolution
-
isDomainResolution
-
getServerService
-
getClientService
-
getDefaultAuthServerProperties
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-