Skip to content

Use more specific LdapAuthority in DefaultLdapAuthoritiesPopulator #5929

@heruan

Description

@heruan

Summary

When using DefaultLdapAuthoritiesPopulator, the set of GrantedAuthorities contains instances of SimpleGrantedAuthority while I would expect instances of LdapAuthority; as it is now, I cannot discriminate LDAP authorities from others.

NestedLdapAuthoritiesPopulator already uses the more specific LdapAuthority.

Actual Behavior

At DefaultLdapAuthoritiesPopulator.java#L255 the authority set is populated wiht:

authorities.add(new SimpleGrantedAuthority(this.rolePrefix + role));

Expected Behavior

I would expect the authority set to be populated with:

authorities.add(new LdapAuthority(this.rolePrefix + role, roleDn));

Version

Spring Security 5.1.0

Metadata

Metadata

Assignees

Labels

in: ldapAn issue in spring-security-ldap

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions