Class DefaultContextHelperService
java.lang.Object
com.broadleafcommerce.auth.client.service.DefaultContextHelperService
- All Implemented Interfaces:
ContextHelperService
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AuthorizationServerService<AuthorizationServer>
protected final AuthorizedClientService<AuthorizedClient>
-
Constructor Summary
ConstructorDescriptionDefaultContextHelperService
(AuthorizedClientService<AuthorizedClient> authorizedClientService, AuthorizationServerService<AuthorizationServer> authorizationServerService) -
Method Summary
Modifier and TypeMethodDescriptionprotected AuthorizationServer
getAuthorizationServer
(String serverId) Finds theAuthorizationServer
for the given server IDprotected AuthorizationServerService<AuthorizationServer>
protected AuthorizedClient
getAuthorizedClient
(String clientId) Finds theAuthorizedClient
corresponding 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.void
setClientId
(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:ContextHelperService
Get the client id from the request context.- Specified by:
getClientId
in interfaceContextHelperService
- Returns:
- The client id from the request context.
-
setClientId
Description copied from interface:ContextHelperService
Set the client id on the request context.- Specified by:
setClientId
in interfaceContextHelperService
- Parameters:
clientId
- The client id parameter from the request.
-
getTenantId
Description copied from interface:ContextHelperService
Use the client id from the request context to look up the tenant id.- Specified by:
getTenantId
in interfaceContextHelperService
- Returns:
- The tenant id that corresponds to the client id in request attributes.
-
getAuthorizedClient
Finds theAuthorizedClient
corresponding 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 theAuthorizationServer
for 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
-