@Service public final class CertificateRealm extends IASRealm
The certificate realm provides the security-service functionality needed to process a client-cert authentication. Since the SSL processing, and client certificate verification is done by NSS, no authentication is actually done by this realm. It only serves the purpose of being registered as the certificate handler realm and to service group membership requests during web container role checks.
There is no JAAS LoginModule corresponding to the certificate realm, therefore this realm does not require the jaas-context configuration parameter to be set. The purpose of a JAAS LoginModule is to implement the actual authentication processing, which for the case of this certificate realm is already done by the time execution gets to Java.
The certificate realm needs the following properties in its configuration: None.
The following optional attributes can also be specified:
| Modifier and Type | Class and Description |
|---|---|
static class |
CertificateRealm.AppContextCallback
A
LoginModule for CertificateRealm
can instantiate and pass a AppContextCallback
to handle method of the passed
CallbackHandler to retrieve the application
name information. |
| Modifier and Type | Field and Description |
|---|---|
static String |
AUTH_TYPE |
JAAS_CONTEXT_PARAM, sm_logger, groupMapper, PARAM_GROUP_MAPPING| Constructor and Description |
|---|
CertificateRealm() |
| Modifier and Type | Method and Description |
|---|---|
void |
authenticate(Subject subject,
sun.security.x509.X500Name x500name)
Complete authentication of certificate user.
|
String |
getAuthType()
Returns a short (preferably less than fifteen characters) description
of the kind of authentication which is supported by this realm.
|
Enumeration |
getGroupNames(String username)
Returns the name of all the groups that this user belongs to.
|
protected void |
init(Properties props)
Initialize a realm with some properties.
|
addUser, addUser, getAuthenticationHandler, getGroupNames, getUser, getUserNames, persist, refresh, removeUser, supportsUserManagement, updateUser, updateUseraddAssignGroups, compareTo, getDefaultDigestAlgorithm, getDefaultInstance, getDefaultRealm, getInstance, getInstance, getJAASContext, getMappedGroupNames, getName, getProperties, getProperty, getRealmNames, getRealmStatsProvier, instantiate, instantiate, instantiate, isValidRealm, isValidRealm, refresh, setDefaultRealm, setName, setProperty, toString, unloadInstance, unloadInstance, updateInstance, updateInstancepublic static final String AUTH_TYPE
protected void init(Properties props) throws BadRealmException, NoSuchRealmException
init in class Realmprops - Initialization parameters used by this realm.BadRealmException - If the configuration parameters
identify a corrupt realm.NoSuchRealmException - If the configuration parameters
specify a realm which doesn't exist.public String getAuthType()
getAuthType in class Realmpublic Enumeration getGroupNames(String username) throws NoSuchUserException, InvalidOperationException
getGroupNames in class Realmusername - Name of the user in this realm whose group listing
is needed.InvalidOperationException - thrown if the realm does not
support this operation - e.g. Certificate realm does not support
this operation.NoSuchUserExceptionpublic void authenticate(Subject subject, sun.security.x509.X500Name x500name)
As noted, the certificate realm does not do the actual authentication (signature and cert chain validation) for the user certificate, this is done earlier in NSS. This method simply sets up the security context for the user in order to properly complete the authentication processing.
If any groups have been assigned to cert-authenticated users through the assign-groups property these groups are added to the security context for the current user.
subject - The Subject object for the authentication request.x500name - The X500Name object from the user certificate.Copyright © 2017. All rights reserved.