Skip to content

Implement providing a custom AuthoritiesPopulator in ADLdapAuthProvider #14539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 9, 2024

Conversation

Haarolean
Copy link
Contributor

Implemented a possibility to provide a custom AuthoritiesPopulator in ActiveDirectoryLdapAuthenticationProvider

Discussed in #4490

  • I have extracted the existing implementation within loadUserAuthorities into a separate default AD populator, the same way it's done for non-AD LDAP AuthenticationProvider. Replaced a for with streams when collecting authorities;
  • Mirrored existing constructors with a new parameter, keeping the old ones for back compatibility;
  • Applied a few straightforward IDE-suggested fixes, let me know if you'd like me to revert them.

Resolves #4490

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 2, 2024
@jzheaux jzheaux self-assigned this Feb 5, 2024
@jzheaux jzheaux added in: ldap An issue in spring-security-ldap type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 5, 2024
Copy link
Contributor

@jzheaux jzheaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, @Haarolean! I've left some feedback inline.

@jzheaux
Copy link
Contributor

jzheaux commented Feb 5, 2024

@Haarolean, just one more thing, if you would please run:

./gradlew format && ./gradlew check

Then it will ensure that the code is following all of Spring Security's formatting standards. Thank you.

@Haarolean
Copy link
Contributor Author

@Haarolean, just one more thing, if you would please run:

./gradlew format && ./gradlew check

Then it will ensure that the code is following all of Spring Security's formatting standards. Thank you.

Thanks, I've done checkFormat but didn't see there's another checkstyle.

@jzheaux jzheaux merged commit 4aed679 into spring-projects:main Feb 9, 2024
@jzheaux jzheaux added this to the 6.3.0-M2 milestone Feb 9, 2024
@jzheaux
Copy link
Contributor

jzheaux commented Feb 9, 2024

Thanks, @Haarolean! This is now merged into main

@Haarolean Haarolean deleted the issues/4490 branch April 12, 2024 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: ldap An issue in spring-security-ldap type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ActiveDirectoryLdapAuthenticationProvider does not support different AuthoritiesPopulator
3 participants