Class AuthD
- java.lang.Object
-
- com.sun.identity.authentication.service.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 Summary
Fields Modifier and Type Field Description static StringBUNDLE_NAMEConfigured bundle name for auth servicestatic DebugdebugDebug instance for error / message loggingStringdefaultAuthLevelDefault auth level for module
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroySession(SessionID sid)Destroy sessionfor givenSessionIDAMIdentityRepositorygetAMIdentityRepository(String orgDN)Returns the OpenAM Identity Repository for an organization.static AuthDgetAuth()Returns Authenticator singleton instance.StringgetAuthenticatorForName(String moduleName)Returns an Authenticator for a specific module name.IteratorgetAuthenticators()Return configured AuthenticatorslonggetDefaultSleepTime()Return default sleep timeAMIdentitygetIdentity(IdType idType, String idName, String orgName)Returns theAMIdentityobject for the given parameters.OrganizationConfigManagergetOrgConfigManager(String orgDN)Returns the Organization Configuration Manager for an organization.StringgetOrgConfiguredAuthenticationChain(String orgDN)Returns the authentication service or chain configured for the given organization.StringgetOrgDN(String userOrg)Returns the organization DN.MapgetOrgServiceAttributes(String orgDN, String serviceName)Returns attribute map of the specified service in the specified organization.StringgetPlatformLocale()Return configured PlatformLocaleResourceBundlegetResourceBundle(String locale)Returns Resource bundle of a locale.AMStoreConnectiongetSDK()Returns connection for AM store.jakarta.servlet.ServletContextgetServletContext()Returns the Servlet Context.static InternalSessiongetSession(SessionID sessionId)Returns the session associated with a session ID.InternalSessiongetSession(jakarta.servlet.http.HttpServletRequest req)Returns the session associated with an HTTP Servlet Request.static InternalSessiongetSession(String sessId)Returns the session associated with a session ID.SSOTokengetSSOAuthSession()Return current sso session for authbooleanisGotoUrlValid(String url, String orgDN)Checks whether an input URL is valid in an organization.booleanisSpecialUser(String dn)Returnstrueif distinguished user name is a special user DN.booleanisSuperAdmin(String dn)Returnstrueif distinguished user name is a super administrator DN.booleanisSuperUser(String dn)Returnstrueif and only if the user name belongs to a super uservoidlogIt(String[] s, int type, String messageName, Hashtable ssoProperties)Writes a log record.voidlogLogout(SSOToken ssot)Log Logout statusstatic InternalSessionnewSession(String domain, boolean stateless)Creates a new session.static InternalSessionnewSession(String domain, boolean stateless, boolean checkCts)Creates a new session.voidnotifyChanges()This method will be call if configuration changed.StringprocessURL(String URL, jakarta.servlet.http.HttpServletRequest servletRequest)Returns the dynamic replacement of the URL from the Success or Failure URLs.voidsetOrgServiceAttributes(String orgDN, String serviceName, Map<String,Set<String>> attributes)Sets the provided attribute map on the specified service in the specified organization.voidsetServletContext(jakarta.servlet.ServletContext servletContext)Sets the Servlet Context.
-
-
-
Field Detail
-
BUNDLE_NAME
public static final String BUNDLE_NAME
Configured bundle name for auth service- See Also:
- Constant Field Values
-
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:
IdRepoExceptionSSOException
-
getAuth
public static AuthD getAuth()
Returns Authenticator singleton instance.- Returns:
- Authenticator singleton instance.
-
destroySession
public void destroySession(SessionID sid)
Destroy sessionfor givenSessionID- Parameters:
sid-SessionIDto 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
InternalSessionassociated 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
InternalSessionassociated 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
InternalSessionassociated with anHTTP Servlet Request.
-
getAuthenticatorForName
public String getAuthenticatorForName(String moduleName)
Returns an Authenticator for a specific module name.- Parameters:
moduleName- Module name exampleLDAP.- 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 eitherLOG_ERRORorLOG_ACCESS.messageName- Message ID for the log record.ssoProperties- Single Sign On Properties to be written to the log record. If this isnull, 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
-
notifyChanges
public void notifyChanges()
Description copied from interface:ConfigurationListenerThis method will be call if configuration changed.- Specified by:
notifyChangesin interfaceConfigurationListener
-
isSuperAdmin
public boolean isSuperAdmin(String dn)
Returnstrueif distinguished user name is a super administrator DN.- Parameters:
dn- Distinguished name of user.- Returns:
trueif user is super administrator.
-
isSuperUser
public boolean isSuperUser(String dn)
Returnstrueif and only if the user name belongs to a super user- Parameters:
dn- DN of the user- Returns:
trueif the user is an admin user.
-
isSpecialUser
public boolean isSpecialUser(String dn)
Returnstrueif distinguished user name is a special user DN.- Parameters:
dn- Distinguished name of user.- Returns:
trueif 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 theAMIdentityobject 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:
AMIdentityobject.- 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.
-
-