Skip to content

Commit

Permalink
Support AD in LDAP authorities extractor. Resolves #54
Browse files Browse the repository at this point in the history
  • Loading branch information
Haarolean committed Dec 16, 2024
1 parent 4853eca commit 36a62bc
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
@Slf4j
public class RbacLdapAuthoritiesExtractor extends NestedLdapAuthoritiesPopulator {

private static final Set<Provider> SUPPORTED_PROVIDERS = Set.of(Provider.LDAP, Provider.LDAP_AD);

private final AccessControlService acs;

public RbacLdapAuthoritiesExtractor(ApplicationContext context,
Expand All @@ -36,7 +38,7 @@ protected Set<GrantedAuthority> getAdditionalRoles(DirContextOperations user, St
.stream()
.filter(r -> r.getSubjects()
.stream()
.filter(subject -> subject.getProvider().equals(Provider.LDAP))
.filter(subject -> SUPPORTED_PROVIDERS.contains(subject.getProvider()))
.filter(subject -> subject.getType().equals("group"))
.anyMatch(subject -> ldapGroups.contains(subject.getValue()))
)
Expand Down

0 comments on commit 36a62bc

Please sign in to comment.