Package io.vertigo.connectors.oidc
Interface IOIDCClient
- All Known Implementing Classes:
OIDCClient
public interface IOIDCClient
Contract for an OpenID Connect client.
- Author:
- skerdudou
-
Method Summary
Modifier and TypeMethodDescriptiongetLoginUrl(URI callbackUri, IOIDCStateStorage oidcStateStorage, Optional<Locale> localeOpt, Map<String, Serializable> additionalInfos, String... requestedScopes) Generates the login URL for the OIDC authentication request.Build the logout URL for the SSO.com.nimbusds.openid.connect.sdk.token.OIDCTokensparseResponse(URI responseUri, URI callbackUri, IOIDCStateStorage oidcStateStorage) Get OIDC tokens from the SSO response.retrieveAdditionalInfos(URI responseUri, IOIDCStateStorage oidcStateStorage) Retrieves the additional infos provided with the matching getLoginUrl call.
-
Method Details
-
getLoginUrl
String getLoginUrl(URI callbackUri, IOIDCStateStorage oidcStateStorage, Optional<Locale> localeOpt, Map<String, Serializable> additionalInfos, String... requestedScopes) Generates the login URL for the OIDC authentication request.- Parameters:
callbackUri- the callback URI to handle the authentication responseoidcStateStorage- the storage to keep the state and nonce for the callbacklocaleOpt- the optional locale to forward to the SSOadditionalInfos- additional infos retrievable at callback timerequestedScopes- the scopes requested for the authentication- Returns:
- the URL to redirect the user to for OIDC authentication
-
parseResponse
com.nimbusds.openid.connect.sdk.token.OIDCTokens parseResponse(URI responseUri, URI callbackUri, IOIDCStateStorage oidcStateStorage) Get OIDC tokens from the SSO response.- Parameters:
responseUri- the current URI, with OIDC parameters (state and code)callbackUri- the callback URI provided when sending user to SSO login pageoidcStateStorage- the storage to retrieve the state and nonce- Returns:
- OIDC tokens (with ID token and Access token)
-
retrieveAdditionalInfos
Map<String,Serializable> retrieveAdditionalInfos(URI responseUri, IOIDCStateStorage oidcStateStorage) Retrieves the additional infos provided with the matching getLoginUrl call.- Parameters:
responseUri- the current URI, with OIDC parameters (state and code)oidcStateStorage- the storage to retrieve the state- Returns:
- the additional infos corresponding to those provided at login time
-
getLogoutUrl
String getLogoutUrl(Optional<URI> redirectUriOpt, Optional<String> idTokenOpt, Optional<Locale> localeOpt) Build the logout URL for the SSO.- Parameters:
redirectUriOpt- the URL to redirect to after logoutidTokenOpt- the ID token of the connected user to logoutlocaleOpt- the user locale- Returns:
- the URL to logout the user from the SSO
-