Interface IOIDCClient

All Known Implementing Classes:
OIDCClient

public interface IOIDCClient
Contract for an OpenID Connect client.
Author:
skerdudou
  • 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 response
      oidcStateStorage - the storage to keep the state and nonce for the callback
      localeOpt - the optional locale to forward to the SSO
      additionalInfos - additional infos retrievable at callback time
      requestedScopes - 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 page
      oidcStateStorage - 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 logout
      idTokenOpt - the ID token of the connected user to logout
      localeOpt - the user locale
      Returns:
      the URL to logout the user from the SSO