Class ActiveMQJAASSecurityManager
java.lang.Object
org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager
- All Implemented Interfaces:
ActiveMQSecurityManager
,ActiveMQSecurityManager5
This implementation delegates to the JAAS security interfaces.
The Subject
returned by the login context is expecting to have a set of RolePrincipal
for each role
of the user.
-
Constructor Summary
ConstructorsConstructorDescriptionActiveMQJAASSecurityManager
(String configurationName) ActiveMQJAASSecurityManager
(String configurationName, String certificateConfigurationName) ActiveMQJAASSecurityManager
(String configurationName, String certificateConfigurationName, org.apache.activemq.artemis.core.config.impl.SecurityConfiguration configuration, org.apache.activemq.artemis.core.config.impl.SecurityConfiguration certificateConfiguration) ActiveMQJAASSecurityManager
(String configurationName, org.apache.activemq.artemis.core.config.impl.SecurityConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionauthenticate
(String user, String password, RemotingConnection remotingConnection, String securityDomain) is this a valid user.boolean
authorize
(Subject subject, Set<org.apache.activemq.artemis.core.security.Role> roles, org.apache.activemq.artemis.core.security.CheckType checkType, String address) Determine whether the given user has the correct role for the given check type.org.apache.activemq.artemis.core.config.impl.SecurityConfiguration
org.apache.activemq.artemis.core.config.impl.SecurityConfiguration
getUserFromSubject
(Subject subject) void
setCertificateConfiguration
(org.apache.activemq.artemis.core.config.impl.SecurityConfiguration certificateConfiguration) void
setCertificateConfigurationName
(String certificateConfigurationName) void
setConfiguration
(org.apache.activemq.artemis.core.config.impl.SecurityConfiguration configuration) void
setConfigurationName
(String configurationName) void
setRolePrincipalClass
(String principalClass) void
setUserPrincipalClass
(String principalClass) boolean
validateUser
(String user, String password) is this a valid user.boolean
validateUserAndRole
(String user, String password, Set<org.apache.activemq.artemis.core.security.Role> roles, org.apache.activemq.artemis.core.security.CheckType checkType) is this a valid user and do they have the correct roleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager
init
-
Constructor Details
-
ActiveMQJAASSecurityManager
public ActiveMQJAASSecurityManager() -
ActiveMQJAASSecurityManager
-
ActiveMQJAASSecurityManager
-
ActiveMQJAASSecurityManager
public ActiveMQJAASSecurityManager(String configurationName, org.apache.activemq.artemis.core.config.impl.SecurityConfiguration configuration) -
ActiveMQJAASSecurityManager
-
-
Method Details
-
getDomain
- Specified by:
getDomain
in interfaceActiveMQSecurityManager
-
validateUser
Description copied from interface:ActiveMQSecurityManager
is this a valid user.- Specified by:
validateUser
in interfaceActiveMQSecurityManager
- Parameters:
user
- the userpassword
- the users password- Returns:
true
if a valid user
-
authenticate
public Subject authenticate(String user, String password, RemotingConnection remotingConnection, String securityDomain) throws NoCacheLoginException Description copied from interface:ActiveMQSecurityManager5
is this a valid user.This method is called instead of
ActiveMQSecurityManager.validateUser(String, String)
.- Specified by:
authenticate
in interfaceActiveMQSecurityManager5
- Parameters:
user
- the userpassword
- the user's passwordremotingConnection
- the user's connection which contains any corresponding SSL certssecurityDomain
- the name of the JAAS security domain to use (can be null)- Returns:
- the Subject of the authenticated user, else null
- Throws:
NoCacheLoginException
-
validateUserAndRole
public boolean validateUserAndRole(String user, String password, Set<org.apache.activemq.artemis.core.security.Role> roles, org.apache.activemq.artemis.core.security.CheckType checkType) Description copied from interface:ActiveMQSecurityManager
is this a valid user and do they have the correct role- Specified by:
validateUserAndRole
in interfaceActiveMQSecurityManager
- Parameters:
user
- the userpassword
- the users passwordroles
- the roles the user hascheckType
- the type of check to perform- Returns:
true
if the user is valid and they have the correct roles
-
authorize
public boolean authorize(Subject subject, Set<org.apache.activemq.artemis.core.security.Role> roles, org.apache.activemq.artemis.core.security.CheckType checkType, String address) Description copied from interface:ActiveMQSecurityManager5
Determine whether the given user has the correct role for the given check type.This method is called instead of
ActiveMQSecurityManager.validateUserAndRole(String, String, Set, CheckType)
.- Specified by:
authorize
in interfaceActiveMQSecurityManager5
- Parameters:
subject
- the Subject to authorizeroles
- the roles configured in the security-settingscheckType
- which permission to validateaddress
- the address (or FQQN) to grant access to- Returns:
true
if the user is authorized, else false
-
getUserFromSubject
- Specified by:
getUserFromSubject
in interfaceActiveMQSecurityManager
-
setConfigurationName
-
setConfiguration
public void setConfiguration(org.apache.activemq.artemis.core.config.impl.SecurityConfiguration configuration) -
setCertificateConfigurationName
-
setCertificateConfiguration
public void setCertificateConfiguration(org.apache.activemq.artemis.core.config.impl.SecurityConfiguration certificateConfiguration) -
getConfiguration
public org.apache.activemq.artemis.core.config.impl.SecurityConfiguration getConfiguration() -
getCertificateConfiguration
public org.apache.activemq.artemis.core.config.impl.SecurityConfiguration getCertificateConfiguration() -
getRolePrincipalClass
-
setRolePrincipalClass
- Throws:
ClassNotFoundException
-
getUserPrincipalClass
-
setUserPrincipalClass
- Throws:
ClassNotFoundException
-