Class DefaultContextHelperService
java.lang.Object
com.broadleafcommerce.auth.client.service.DefaultContextHelperService
- All Implemented Interfaces:
ContextHelperService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AuthorizationServerService<AuthorizationServer>protected final AuthorizedClientService<AuthorizedClient> -
Constructor Summary
ConstructorsConstructorDescriptionDefaultContextHelperService(AuthorizedClientService<AuthorizedClient> authorizedClientService, AuthorizationServerService<AuthorizationServer> authorizationServerService) -
Method Summary
Modifier and TypeMethodDescriptionprotected AuthorizationServergetAuthorizationServer(String serverId) Finds theAuthorizationServerfor the given server IDprotected AuthorizationServerService<AuthorizationServer>protected AuthorizedClientgetAuthorizedClient(String clientId) Finds theAuthorizedClientcorresponding to the given client IDprotected AuthorizedClientService<AuthorizedClient>Get the client id from the request context.Use the client id from the request context to look up the tenant id.voidsetClientId(String clientId) Set the client id on the request context.
-
Field Details
-
authorizedClientService
-
authorizationServerService
-
-
Constructor Details
-
DefaultContextHelperService
public DefaultContextHelperService(AuthorizedClientService<AuthorizedClient> authorizedClientService, AuthorizationServerService<AuthorizationServer> authorizationServerService)
-
-
Method Details
-
getClientId
Description copied from interface:ContextHelperServiceGet the client id from the request context.- Specified by:
getClientIdin interfaceContextHelperService- Returns:
- The client id from the request context.
-
setClientId
Description copied from interface:ContextHelperServiceSet the client id on the request context.- Specified by:
setClientIdin interfaceContextHelperService- Parameters:
clientId- The client id parameter from the request.
-
getTenantId
Description copied from interface:ContextHelperServiceUse the client id from the request context to look up the tenant id.- Specified by:
getTenantIdin interfaceContextHelperService- Returns:
- The tenant id that corresponds to the client id in request attributes.
-
getAuthorizedClient
Finds theAuthorizedClientcorresponding to the given client ID- Parameters:
clientId- The client id from the web request- Returns:
- the authorized client from the datastore that matches the given client ID
- Throws:
IllegalArgumentException- if the client was not found
-
getAuthorizationServer
Finds theAuthorizationServerfor the given server ID- Parameters:
serverId- the id of the authorization server to retrieve- Returns:
- the authorization server from the datastore matching the given serverID
- Throws:
IllegalArgumentException- if the authorization server was not found
-
getAuthorizedClientService
-
getAuthorizationServerService
-