Class ClientCredentialsSession.Builder
java.lang.Object
com.janeirodigital.sai.authentication.ClientCredentialsSession.Builder
- Enclosing class:
- ClientCredentialsSession
Builder for
ClientCredentialsSession
instances. Requires methods to be called
in a particular order to establish the session successfully.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Constructs aClientCredentialsSession
once all of the requisite operations have completed successfully.Request tokens from the token endpoint of the openid connect providersetApplication
(URI applicationId) Optional - Sets the application identifier associated with the registered client.setClientIdentifier
(String clientIdentifier) Sets the client identifier that will be used to authenticate with the oidc provider.setClientSecret
(String clientSecret) Sets the client secret that will be used to authenticate with the oidc provider.setOidcProvider
(URI oidcProviderId) Sets the openid connect provider that the client is registered with.Sets the authorization scopes to use in the authorization requestsetSocialAgent
(URI socialAgentId) Optional - Sets the social agent associated with the registered client.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setSocialAgent
Optional - Sets the social agent associated with the registered client. This is synonymous with the value that the oidc provider will insert into the webid claim of the client's access token.- Parameters:
socialAgentId
- URI of the social agent responsible for the application- Returns:
- ClientCredentialsSession.Builder
-
setApplication
Optional - Sets the application identifier associated with the registered client.- Parameters:
applicationId
- URI of the client application identity- Returns:
- ClientCredentialsSession.Builder
-
setOidcProvider
public ClientCredentialsSession.Builder setOidcProvider(URI oidcProviderId) throws SaiAuthenticationException Sets the openid connect provider that the client is registered with. Will be checked for validity via .well-known/openid-configuration discovery- Parameters:
oidcProviderId
- URI of the oidc provider- Returns:
- ClientCredentialsSession.Builder
- Throws:
SaiAuthenticationException
-
setClientIdentifier
Sets the client identifier that will be used to authenticate with the oidc provider.- Parameters:
clientIdentifier
- client identifier that has been registered with the oidc provider- Returns:
- ClientCredentialsSession.Builder
-
setClientSecret
Sets the client secret that will be used to authenticate with the oidc provider.- Parameters:
clientSecret
- client secret that has been registered with the oidc provider for the clientIdentifier- Returns:
- ClientCredentialsSession.Builder
-
setScope
Sets the authorization scopes to use in the authorization request- Parameters:
scopes
- List of scopes to include in request- Returns:
- ClientCredentialsSession.Builder
-
requestToken
Request tokens from the token endpoint of the openid connect provider- Returns:
- SolidOidcSession.Builder
- Throws:
SaiAuthenticationException
-
build
Constructs aClientCredentialsSession
once all of the requisite operations have completed successfully.- Returns:
ClientCredentialsSession
-