Skip to content

elytron security: define role mapper (was: ldap security - role mapper) #10264

@hyperman1

Description

@hyperman1

Description
ldap security today requires that the application has identical names for ldap groups and application roles. But this is not realistic. most orgs have a naming convention for ldap objects, which will clash with java group names.

Implementation ideas
Elytron has the required possibilities, they need to be made accessible from quarkus. You have to decide if this is ldap-only or general. Code goes more or less like this:

Adapt the class:

     In io.quarkus.elytron.security.runtime.ElytronRecorder # configureDomainBuilder:

I assume a config more or less like this:

   quarkus.security.grouptorole.SOME_LDAP_GROUP_NAME=role1,role2

Add something like:

	Map<String, Set<String>> roleMap = new HashMap<>();
	for  each GROUP & ROLE from the config:
		roleMap.put(GROUP, new HashSet<>(Arrays.asList(ROLE.trim().split(" *, *"))));
	<the realm builder, just after the call to setRoleDecoder>
                     .setRoleMapper(MappedRoleMapper.builder().setRoleMap(roleMap).build());

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions