Class OidcNopProvider

java.lang.Object
net.datenwerke.oidc.client.provider.OidcNopProvider
All Implemented Interfaces:
OidcService, OidcProvider
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

public final class OidcNopProvider extends Object implements OidcService
Dummy oidc provider used when oidc is deactivated in properties to avoid errors and being stuck during init.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • 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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OidcNopProvider

      public OidcNopProvider()
  • Method Details

    • getLogoutUrl

      public 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.

      NOP: just return the redirect uri. Important for LoginService.

      Specified by:
      getLogoutUrl in interface OidcProvider
      Parameters:
      redirectUri - The redirect uri to be included in the logout url.
      Returns:
      The oidc logout url including the redirect uri.
    • getToken

      public String getToken()
      Returns the jwt access token as string associated with the current session if any or null otherwise.

      NOP: just return the null.

      Specified by:
      getToken in interface OidcProvider
      Returns:
      The jwt access token or null if no session.
    • getIdToken

      public 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.

      NOP: just return null.

      Specified by:
      getIdToken in interface OidcProvider
      Returns:
      the ID token or null if no ID token is available
    • login

      public 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.

      NOP: do nothing.

      Specified by:
      login in interface OidcProvider
      Parameters:
      locale - The locale to be used on oidc provider login page.
    • registerCallback

      public void registerCallback(OidcCallback callback)
      Register any OidcCallback at the implementing oidc provider.

      If ReadyCallback instantly execute the callback.

      Specified by:
      registerCallback in interface OidcProvider
      Parameters:
      callback - The callback to register.