Class AuthD

  • All Implemented Interfaces:
    ConfigurationListener

    public class AuthD
    extends Object
    implements ConfigurationListener
    This class is used to initialize the Authentication service and retrieve the Global attributes for the Authentication service. It also initializes the other dependent services in the OpenAM system and hence used as bootstrap class for the authentication server.
    • Field Detail

      • debug

        public static final Debug debug
        Debug instance for error / message logging
      • defaultAuthLevel

        public String defaultAuthLevel
        Default auth level for module
    • Method Detail

      • getOrgServiceAttributes

        public Map getOrgServiceAttributes​(String orgDN,
                                           String serviceName)
        Returns attribute map of the specified service in the specified organization.
        Parameters:
        orgDN - Organization DN in which the service exists.
        serviceName - Service name of which the attributes are retrieved.
        Returns:
        Map containing the attributes of the service.
      • setOrgServiceAttributes

        public void setOrgServiceAttributes​(String orgDN,
                                            String serviceName,
                                            Map<String,​Set<String>> attributes)
                                     throws IdRepoException,
                                            SSOException
        Sets the provided attribute map on the specified service in the specified organization.
        Parameters:
        orgDN - Organization DN in which the service exists.
        serviceName - Service name of which the attributes are retrieved.
        attributes - The attributes to set on the service.
        Throws:
        IdRepoException
        SSOException
      • getAuth

        public static AuthD getAuth()
        Returns Authenticator singleton instance.
        Returns:
        Authenticator singleton instance.
      • destroySession

        public void destroySession​(SessionID sid)
        Destroy sessionfor given SessionID
        Parameters:
        sid - SessionID to be destroyed
      • newSession

        public static InternalSession newSession​(String domain,
                                                 boolean stateless)
        Creates a new session.
        Parameters:
        domain - Domain Name.
        Returns:
        new InternalSession
      • newSession

        public static InternalSession newSession​(String domain,
                                                 boolean stateless,
                                                 boolean checkCts)
        Creates a new session.
        Parameters:
        domain - Domain Name.
        Returns:
        new InternalSession
      • getSession

        public static InternalSession getSession​(String sessId)
        Returns the session associated with a session ID.
        Parameters:
        sessId - Session ID.
        Returns:
        the InternalSession associated with a session ID.
      • getSession

        public static InternalSession getSession​(SessionID sessionId)
        Returns the session associated with a session ID.
        Parameters:
        sessionId - Session ID.
        Returns:
        the InternalSession associated with a session ID.
      • getSession

        public InternalSession getSession​(jakarta.servlet.http.HttpServletRequest req)
        Returns the session associated with an HTTP Servlet Request.
        Parameters:
        req - HTTP Servlet Request.
        Returns:
        the InternalSession associated with anHTTP Servlet Request.
      • getAuthenticatorForName

        public String getAuthenticatorForName​(String moduleName)
        Returns an Authenticator for a specific module name.
        Parameters:
        moduleName - Module name example LDAP.
        Returns:
        Authenticator for a specific module name.
      • getAuthenticators

        public Iterator getAuthenticators()
        Return configured Authenticators
        Returns:
        list of configured Authenticators
      • getPlatformLocale

        public String getPlatformLocale()
        Return configured PlatformLocale
        Returns:
        configured PlatformLocale
      • logLogout

        public void logLogout​(SSOToken ssot)
        Log Logout status
      • logIt

        public void logIt​(String[] s,
                          int type,
                          String messageName,
                          Hashtable ssoProperties)
        Writes a log record.
        Parameters:
        s - Array of data information for the log record.
        type - Type of log either LOG_ERROR or LOG_ACCESS.
        messageName - Message ID for the log record.
        ssoProperties - Single Sign On Properties to be written to the log record. If this is null, properties will be retrieved from administrator Single Sign On Token.
      • getSDK

        public AMStoreConnection getSDK()
        Returns connection for AM store. Only used for backward compatibilty support, for retrieving user container DN and usernaming attr.
        Returns:
        connection for AM store
      • getSSOAuthSession

        public SSOToken getSSOAuthSession()
        Return current sso session for auth
        Returns:
        current sso session for auth
      • isSuperAdmin

        public boolean isSuperAdmin​(String dn)
        Returns true if distinguished user name is a super administrator DN.
        Parameters:
        dn - Distinguished name of user.
        Returns:
        true if user is super administrator.
      • isSuperUser

        public boolean isSuperUser​(String dn)
        Returns true if and only if the user name belongs to a super user
        Parameters:
        dn - DN of the user
        Returns:
        true if the user is an admin user.
      • isSpecialUser

        public boolean isSpecialUser​(String dn)
        Returns true if distinguished user name is a special user DN.
        Parameters:
        dn - Distinguished name of user.
        Returns:
        true if user is a special user.
      • getResourceBundle

        public ResourceBundle getResourceBundle​(String locale)
        Returns Resource bundle of a locale.
        Parameters:
        locale - Locale.
        Returns:
        Resource bundle of a locale.
      • getDefaultSleepTime

        public long getDefaultSleepTime()
        Return default sleep time
        Returns:
        default sleep time
      • getOrgDN

        public String getOrgDN​(String userOrg)
        Returns the organization DN.

        If the organization name matches the root suffix or has the root suffix in it then the DN will be returned as string. Otherwise the DN will be constructed from the organization Name DN and the root suffix DN.

        Parameters:
        userOrg - Organization Name
        Returns:
        Organization DN of the organization
      • processURL

        public String processURL​(String URL,
                                 jakarta.servlet.http.HttpServletRequest servletRequest)
        Returns the dynamic replacement of the URL from the Success or Failure URLs.
        Parameters:
        URL -
        servletRequest -
        Returns:
        the dynamic replacement of the URL from the Success or Failure URLs.
      • setServletContext

        public void setServletContext​(jakarta.servlet.ServletContext servletContext)
        Sets the Servlet Context.
        Parameters:
        servletContext - Servlet Context to be set.
      • getServletContext

        public jakarta.servlet.ServletContext getServletContext()
        Returns the Servlet Context.
        Returns:
        Servlet Context.
      • getAMIdentityRepository

        public AMIdentityRepository getAMIdentityRepository​(String orgDN)
        Returns the OpenAM Identity Repository for an organization.
        Parameters:
        orgDN - name of the organization
        Returns:
        OpenAM Identity Repository.
      • getOrgConfigManager

        public OrganizationConfigManager getOrgConfigManager​(String orgDN)
        Returns the Organization Configuration Manager for an organization.
        Parameters:
        orgDN - Name of the organization.
        Returns:
        Organization Configuration Manager for an organization.
      • getIdentity

        public AMIdentity getIdentity​(IdType idType,
                                      String idName,
                                      String orgName)
                               throws AuthException
        Returns the AMIdentity object for the given parameters. If there is no such identity, or there is more then one matching identity, then an AuthException will be thrown.
        Parameters:
        idType - Identity Type.
        idName - Identity Name.
        orgName - organization name.
        Returns:
        AMIdentity object.
        Throws:
        AuthException - if there was no result, or if there was more results then one.
      • getOrgConfiguredAuthenticationChain

        public String getOrgConfiguredAuthenticationChain​(String orgDN)
        Returns the authentication service or chain configured for the given organization.
        Parameters:
        orgDN - organization DN.
        Returns:
        the authentication service or chain configured for the given organization.
      • isGotoUrlValid

        public boolean isGotoUrlValid​(String url,
                                      String orgDN)
        Checks whether an input URL is valid in an organization.
        Parameters:
        url - The URL to be validated.
        orgDN - The organization DN.
        Returns:
        true if input URL is valid, false otherwise.