I’m trying to add LDAP sign in feature to ActiveMQ Artemis instance
I’ve set my login.config like this:
activemq {
org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule sufficient
debug=true
initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory
connectionURL="ldap://office.company.com:389"
connectionUsername="cn=ldap.user,ou=technical,ou=city,dc=office,dc=company,dc=com"
connectionPassword="password"
connectionProtocol=s
connectionTimeout="5000"
authentication=simple
userBase="ou=department,ou=city,dc=office,dc=company,dc=com"
userSearchMatching="(sAMAccountName={0})"
userSearchSubtree=true
readTimeout="5000"
roleBase="ou=department,ou=city,dc=office,dc=company,dc=com"
roleName="cn"
roleSearchMatching="(&(objectClass=group)(cn=R&D-Dev)(member:1.2.840.113556.1.4.1941:=cn={0}))"
roleSearchSubtree=true;
org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule optional
reload=true
org.apache.activemq.jaas.properties.user="artemis-users.properties"
org.apache.activemq.jaas.properties.role="artemis-roles.properties";
};
Then I changed default value in artemis.profile from HAWTIO_ROLE=’amq’ to HAWTIO_ROLE=’*’
This configuration allows me to log in with the LDAP account but wherever I check I’m receiving an error like this:
ERROR: User not authorized to access attribute: AddressLimitPercent (class java.lang.SecurityException)
My LDAP tree looks like this
dc=com
└── dc=company
└── dc=office
├── ou=city
│ ├── ou=technical
│ │ └── cn=ldap.user
│ └── ou=department
│ ├── sAMAccountName=name.lastname
│ └── cn=R&D-Dev
I’ve tried mapping my LDAP role to internal amq role in artemis-roles.properties
amq = R&D-Dev
Error