Skip to content

Instantly share code, notes, and snippets.

@francescm
Created June 24, 2013 08:17
Show Gist options
  • Save francescm/5848518 to your computer and use it in GitHub Desktop.
Save francescm/5848518 to your computer and use it in GitHub Desktop.
jaas login.config to secure activemq web console with ldaptive
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
activemq-local {
org.apache.activemq.jaas.PropertiesLoginModule required
debug=true
org.apache.activemq.jaas.properties.user="org/apache/activemq/security/users.properties"
org.apache.activemq.jaas.properties.group="org/apache/activemq/security/groups.properties";
};
jetty-ldap {
org.ldaptive.jaas.LdapLoginModule required
debug=true
storePass="true"
ldapUrl="ldap://ldap1.test.com:389 ldap://ldap2.test.com:389"
connectionStrategy="ACTIVE_PASSIVE"
baseDn="ou=people,dc=test,dc=com"
useStartTLS="true"
credentialConfig="{trustCertificates=file:/etc/ssl/certs/ca-chain.pem}"
userFilter="(uid={user})";
org.ldaptive.jaas.LdapRoleAuthorizationModule required
useFirstPass="true"
ldapUrl="ldap://ldap1.test.com:389 ldap://ldap2.test.com:389"
connectionStrategy="ACTIVE_PASSIVE"
bindDn="cn=jetty-jaas,ou=agents,dc=test,dc=com"
baseDn="ou=groups,dc=test,dc=com"
bindCredential="secret"
roleFilter="(memberUid={user})"
useStartTLS="true"
credentialConfig="{trustCertificates=file:/etc/ssl/certs/ca-chain.pem}"
roleAttribute="cn";
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment