Class AuthenticationHandler

    • Constructor Detail

      • AuthenticationHandler

        public AuthenticationHandler()
    • Method Detail

      • getClient

        @Nullable
        public static IClientDescriptor getClient​(IEntityContext ec,
                                                  String clientName)
        Returns the client for the given client name.
        Parameters:
        ec - Current entity context for accessing the database.
        clientName - to get client descriptor for
        Returns:
        the client for the given client name if available or null if none was found
        Since:
        8.0.0
      • getAuthenticator

        public IAuthenticator<?> getAuthenticator​(UserContext uc,
                                                  UUID callbackUuid)
        Description copied from interface: IAuthenticationHandler
        Returns the authenticator with the given callback UUID.
        Specified by:
        getAuthenticator in interface IAuthenticationHandler
        Parameters:
        uc - User context for accessing the database.
        callbackUuid - Callback UUI of the authenticator
        Returns:
        authenticator with the given callback UUID.
      • getActiveClientDescriptor

        public IClientDescriptor getActiveClientDescriptor​(UserContext uc,
                                                           String clientName)
        Description copied from interface: IAuthenticationHandler
        Returns the client descriptor for the given client name. The client needs to be active.
        Specified by:
        getActiveClientDescriptor in interface IAuthenticationHandler
        Parameters:
        uc - user context for accessing the database.
        clientName - name of the client.
        Returns:
        the client descriptor for the given client name iff it is active and null otherwise.
      • getActiveClientDescriptors

        public Map<String,​IClientDescriptor> getActiveClientDescriptors​(UserContext uc,
                                                                              Set<String> clientNames)
        Description copied from interface: IAuthenticationHandler
        Returns the client descriptors for the given client names. The clients need to be active.
        Specified by:
        getActiveClientDescriptors in interface IAuthenticationHandler
        Parameters:
        uc - user context for accessing the database.
        clientNames - names of the clients.
        Returns:
        the client descriptors for the given client names iff they are active as a map. The keys of the map entries are the client names.
      • getBackendClientDescriptors

        public List<IClientDescriptor> getBackendClientDescriptors​(UserContext uc)
        Description copied from interface: IAuthenticationHandler
        Finds all active client descriptors that are configured for the backend in order. Clients with credentials authenticators are at the beginning of the list.
        Specified by:
        getBackendClientDescriptors in interface IAuthenticationHandler
        Parameters:
        uc - user context for accessing the database.
        Returns:
        ordered list of all active client descriptors configured for the backend.
      • getBackendInputClientDescriptors

        public List<IClientDescriptor> getBackendInputClientDescriptors​(UserContext uc)
        Description copied from interface: IAuthenticationHandler
        Finds all active client descriptors that are configured for the backend and that require direct input of credentials in order.
        Specified by:
        getBackendInputClientDescriptors in interface IAuthenticationHandler
        Parameters:
        uc - user context for accessing the database.
        Returns:
        ordered list of all active client descriptors configured for the backend and require direct input of credentials.
      • getBackendRedirectClientDescriptors

        public List<IClientDescriptor> getBackendRedirectClientDescriptors​(UserContext uc)
        Description copied from interface: IAuthenticationHandler
        Finds all active client descriptors that are configured for the backend and redirect the user to an external IDP (in order).
        Specified by:
        getBackendRedirectClientDescriptors in interface IAuthenticationHandler
        Parameters:
        uc - user context for accessing the database.
        Returns:
        ordered list of all active client descriptors configured for the backend and redirect the user to an external IDP.
      • getClientDescriptor

        @Nullable
        public IClientDescriptor getClientDescriptor​(UserContext uc,
                                                     String clientName)
        Description copied from interface: IAuthenticationHandler
        Returns the client for the given client name.
        Specified by:
        getClientDescriptor in interface IAuthenticationHandler
        Parameters:
        uc - user context for accessing the database.
        clientName - name of the client (callback UUID or authentication client type nam).
        Returns:
        the pac4j client for the given client name or null if none could be found.
      • getUserProfileByCredentials

        public org.pac4j.core.profile.UserProfile getUserProfileByCredentials​(UserContext uc,
                                                                              UUID callbackUuid,
                                                                              String userName,
                                                                              String password)
        Description copied from interface: IAuthenticationHandler
        Gets the user profile for the given authenticator. Only allowed for LDAP authenticators at the moment.
        Specified by:
        getUserProfileByCredentials in interface IAuthenticationHandler
        Parameters:
        uc - User context for accessing the database.
        callbackUuid - Callback UUID of the authenticator
        userName - Name of the user
        password - Password of the user
        Returns:
        the pac4j UserProfile of the user if the user was successfully validated.
      • getClientDescriptorsByUserPortal

        public PagedResult<IClientDescriptor> getClientDescriptorsByUserPortal​(UserContext uc,
                                                                               UUID userPortalUuid,
                                                                               int page,
                                                                               int pageSize)
        Description copied from interface: IAuthenticationHandler
        Gets all client descriptors available for the user portal given by its UUID.
        Specified by:
        getClientDescriptorsByUserPortal in interface IAuthenticationHandler
        Parameters:
        uc - user context for database transactions.
        userPortalUuid - UUID of the user portal to get the client descriptors for.
        page - page to get.
        pageSize - size of the page to get.
        Returns:
        the client descriptors available for the user portal given by its UUID.