Class CertificateLoginModule
java.lang.Object
org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoader
org.apache.activemq.artemis.spi.core.security.jaas.CertificateLoginModule
- All Implemented Interfaces:
LoginModule, AuditLoginModule
- Direct Known Subclasses:
TextFileCertificateLoginModule
A LoginModule that allows for authentication based on SSL certificates. Allows for subclasses to define methods used
to verify user certificates and find user roles. Uses CertificateCallbacks to retrieve certificates.
-
Nested Class Summary
Nested classes/interfaces inherited from class PropertiesLoader
PropertiesLoader.FileNameKey -
Field Summary
Fields inherited from class PropertiesLoader
debug, LOGIN_CONFIG_SYS_PROP_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanabort()Standard JAAS override.booleancommit()Overriding to complete login process.protected StringgetDistinguishedName(X509Certificate[] certs) protected abstract StringShould return a unique name corresponding to the certificates given.getUserRoles(String username) Should return a set of the roles this user belongs to.voidinitialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) Overriding to allow for proper initialization.booleanlogin()Overriding to allow for certificate-based login.booleanlogout()Standard JAAS override.Methods inherited from class PropertiesLoader
booleanOption, init, load, load, reload, resetUsersAndGroupsCacheMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AuditLoginModule
registerFailureForAudit
-
Constructor Details
-
CertificateLoginModule
public CertificateLoginModule()
-
-
Method Details
-
initialize
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) Overriding to allow for proper initialization. Standard JAAS.- Specified by:
initializein interfaceLoginModule
-
login
Overriding to allow for certificate-based login. Standard JAAS.- Specified by:
loginin interfaceLoginModule- Throws:
LoginException
-
commit
Overriding to complete login process. Standard JAAS.- Specified by:
commitin interfaceLoginModule- Throws:
LoginException
-
abort
Standard JAAS override.- Specified by:
abortin interfaceLoginModule- Throws:
LoginException
-
logout
-
getUserNameForCertificates
Should return a unique name corresponding to the certificates given. The name returned will be used to look up access levels as well as role associations.- Parameters:
certs- The distinguished name.- Returns:
- The unique name if the certificate is recognized, null otherwise
- Throws:
LoginException
-
getUserRoles
Should return a set of the roles this user belongs to. The roles returned will be added to the user's credentials.- Parameters:
username- The username of the client. This is the same name that getUserNameForDn returned for the user's DN.- Returns:
- A Set of the names of the roles this user belongs to
- Throws:
LoginException
-
getDistinguishedName
-