Interface OidcProvider

All Known Subinterfaces:
OidcProvider, OidcService
All Known Implementing Classes:
Keycloak, Nimbus, OidcNopProvider

public interface OidcProvider
Oidc interface for implementing providers on client-side.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the OpenID Connect (OIDC) ID token associated with the current user session.
    getLogoutUrl(String redirectUri)
    Returns the url that needs to be called to terminate the session of the implementing oidc provider containing the redirect uri where the user is redirected to after logout.
    Returns the jwt access token as string associated with the current session if any or null otherwise.
    void
    login(String locale)
    Login method called when hitting the oidc login button.
    void
    Register any OidcCallback at the implementing oidc provider.
  • Method Details

    • getLogoutUrl

      String getLogoutUrl(String redirectUri)
      Returns the url that needs to be called to terminate the session of the implementing oidc provider containing the redirect uri where the user is redirected to after logout.
      Parameters:
      redirectUri - The redirect uri to be included in the logout url.
      Returns:
      The oidc logout url including the redirect uri.
    • getToken

      String getToken()
      Returns the jwt access token as string associated with the current session if any or null otherwise.
      Returns:
      The jwt access token or null if no session.
    • getIdToken

      String getIdToken()
      Returns the OpenID Connect (OIDC) ID token associated with the current user session.

      The ID token is a token issued by the OIDC provider during authentication. It primarily contains identity information about the authenticated user (e.g. sub, preferred_username, email).

      Unlike the access token, which is used to authorize API calls and can be introspected by the resource server, the ID token is meant for the client itself to verify the user’s identity.

      Returns:
      the ID token or null if no ID token is available
    • login

      void login(String locale)
      Login method called when hitting the oidc login button. This method redirects to the actual login of the implementing oidc provider.
      Parameters:
      locale - The locale to be used on oidc provider login page.
    • registerCallback

      void registerCallback(OidcCallback callback)
      Register any OidcCallback at the implementing oidc provider.
      Parameters:
      callback - The callback to register.