Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Commit

Permalink
fix(ldap): role-mapping should not have to be set anymore and is remo…
Browse files Browse the repository at this point in the history
…ved from configuration file

Closes gravitee-io/issues#492
  • Loading branch information
brasseld committed Mar 9, 2017
1 parent 3477d05 commit 7532e50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Expand Up @@ -72,12 +72,10 @@ public SecurityConfigurer configure() throws Exception {

ldapAuthenticationProviderConfigurer.ldapAuthoritiesPopulator(populator).contextSource(contextSource);

// set up roles mapper
if (environment.getProperty("role-mapping", Boolean.class, false)) {
UserDetailsContextPropertiesMapper userDetailsContextPropertiesMapper = new UserDetailsContextPropertiesMapper();
userDetailsContextPropertiesMapper.setEnvironment(environment);
ldapAuthenticationProviderConfigurer.userDetailsContextMapper(userDetailsContextPropertiesMapper);
}
// set up LDAP mapper
UserDetailsContextPropertiesMapper userDetailsContextPropertiesMapper = new UserDetailsContextPropertiesMapper();
userDetailsContextPropertiesMapper.setEnvironment(environment);
ldapAuthenticationProviderConfigurer.userDetailsContextMapper(userDetailsContextPropertiesMapper);

return ldapAuthenticationProviderConfigurer;
}
Expand Down
Expand Up @@ -149,9 +149,7 @@ security:
# group-search-filter: "member={0}"
# Specifies the attribute name which contains the role name. Default is "cn".
# group-role-attribute: "cn"
# If role-mapping is equals to true (default to false)
# Use role-mapper to map LDAP role with internal Gravitee role (syntax { "user_ldap_role" : "user_new_added_ldap_role"})
# role-mapping: true
# role-mapper: {
# GRAVITEE-CONSUMERS: API_CONSUMER,
# GRAVITEE-PUBLISHERS: API_PUBLISHER,
Expand Down

0 comments on commit 7532e50

Please sign in to comment.