Class PamRealm
-
- All Implemented Interfaces:
Comparable<Realm>
@Service public final class PamRealm extends AppservRealm
Realm wrapper for supporting PAM based authentication for all Unix machines. The PAM realm uses the Operating System's PAM login mechanism to authenticate the applications with their OS usernames and passwords.- Author:
- Nithya Subramanian
-
-
Field Summary
Fields Modifier and Type Field Description static String
AUTH_TYPE
Descriptive string of the authentication type of this realm.-
Fields inherited from class com.sun.enterprise.security.auth.realm.Realm
_logger, JAAS_CONTEXT_PARAM, RI_DEFAULT
-
Fields inherited from class com.sun.enterprise.security.auth.realm.AbstractStatefulRealm
groupMapper, GROUPS_SEP, PARAM_DEFAULT_DIGEST_ALGORITHM, PARAM_GROUP_MAPPING, PARAM_GROUPS
-
-
Constructor Summary
Constructors Constructor Description PamRealm()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jvnet.libpam.UnixUser
authenticate(String username, char[] password)
String
getAuthType()
Returns a short (preferably less than fifteen characters) description of the kind of authentication which is supported by this realm.Enumeration<String>
getGroupNames(String username)
Returns the name of all the groups that this user belongs toString
getPamService()
This method retrieves the PAM service stack to be used by the Realm class and Login Module uniformlyprotected void
init(Properties props)
Initialize a realm with some properties.-
Methods inherited from class com.sun.enterprise.security.BaseRealm
addUser, addUser, getGroupNames, getUser, getUserNames, persist, refresh, removeUser, supportsUserManagement, updateUser, updateUser
-
Methods inherited from class com.sun.enterprise.security.auth.realm.Realm
getDefaultInstance, getDefaultRealm, getInstance, getInstance, getRealmNames, getRealmStatsProvier, instantiate, instantiate, isValidRealm, isValidRealm, setDefaultRealm, unloadInstance, unloadInstance, updateInstance, updateInstance
-
Methods inherited from class com.sun.enterprise.security.auth.realm.AbstractStatefulRealm
addAssignGroups, compareTo, getDefaultDigestAlgorithm, getJAASContext, getMappedGroupNames, getName, getProperties, getProperty, refresh, setName, setProperty, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Field Detail
-
AUTH_TYPE
public static final String AUTH_TYPE
Descriptive string of the authentication type of this realm.- See Also:
- Constant Field Values
-
-
Method Detail
-
init
protected void init(Properties props) throws BadRealmException, NoSuchRealmException
Description copied from class:AbstractStatefulRealm
Initialize a realm with some properties. This can be used when instantiating realms from their descriptions. This method may only be called a single time.- Overrides:
init
in classAbstractStatefulRealm
- Parameters:
props
- initialization parameters used by this realm.- Throws:
BadRealmException
- if the configuration parameters identify a corrupt realmNoSuchRealmException
- if the configuration parameters specify a realm which doesn't exist
-
getAuthType
public String getAuthType()
Description copied from class:AbstractRealm
Returns a short (preferably less than fifteen characters) description of the kind of authentication which is supported by this realm.- Specified by:
getAuthType
in classAbstractRealm
- Returns:
- "pam".
-
getGroupNames
public Enumeration<String> getGroupNames(String username) throws NoSuchUserException
Description copied from class:AbstractRealm
Returns the name of all the groups that this user belongs to- Specified by:
getGroupNames
in classAbstractRealm
- Parameters:
username
- name of the user in this realm whose group listing is needed.- Returns:
- enumeration of group names (strings)
- Throws:
NoSuchUserException
-
authenticate
public org.jvnet.libpam.UnixUser authenticate(String username, char[] password)
-
-