@Service public final class CertificateRealm extends BaseRealm
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 properties can also be specified:
OID names whose values
in certificate's distinguished name will be used as a group names.
| 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
Descriptive string of the authentication type of this realm.
|
_logger, JAAS_CONTEXT_PARAM, RI_DEFAULTgroupMapper, GROUPS_SEP, PARAM_DEFAULT_DIGEST_ALGORITHM, PARAM_GROUP_MAPPING, PARAM_GROUPS| Constructor and Description |
|---|
CertificateRealm() |
| Modifier and Type | Method and Description |
|---|---|
String |
authenticate(Subject subject,
X500Principal principal) |
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)
WARN: does not have access to user's certificate, so it does not return groups based on certificate.
|
protected void |
init(Properties props)
Initialize a realm with some properties.
|
addUser, addUser, getGroupNames, getUser, getUserNames, persist, refresh, removeUser, supportsUserManagement, updateUser, updateUsergetDefaultInstance, getDefaultRealm, getInstance, getInstance, getRealmNames, getRealmStatsProvier, instantiate, instantiate, isValidRealm, isValidRealm, setDefaultRealm, unloadInstance, unloadInstance, updateInstance, updateInstanceaddAssignGroups, compareTo, getDefaultDigestAlgorithm, getJAASContext, getMappedGroupNames, getName, getProperties, getProperty, refresh, setName, setProperty, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcompareTopublic static final String AUTH_TYPE
protected void init(Properties props) throws BadRealmException, NoSuchRealmException
AbstractStatefulRealminit in class AbstractStatefulRealmprops - initialization parameters used by this realm.BadRealmException - if the configuration parameters identify a corrupt realmNoSuchRealmException - if the configuration parameters specify a realm which doesn't
existpublic String getAuthType()
getAuthType in class AbstractRealmpublic Enumeration<String> getGroupNames(String username)
getGroupNames in class AbstractRealmusername - name of the user in this realm whose group listing is needed.public String authenticate(Subject subject, X500Principal principal)
subject - The Subject object for the authentication request.principal - The Principal object from the user certificate.Copyright © 2021. All rights reserved.