Skip to content
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

Fixes #23112: Add the role-retrieving OIDC feature to OAuth2 #581

Conversation

fanf
Copy link
Member

@fanf fanf commented Jul 21, 2023

https://issues.rudder.io/issues/23112

The role mapping was only done in a OIDC case, in a buildUser function in the OIDC specialized loadUser function.
That PR factorize-out the buildUser function to put it into the generic RudderUserServerMapping trait. That works well because we retrieve group attribute with a function (getAttribute[java.util.ArrayList[String]](reg.roles.attributeName)) that is common to both protocol.
The remaining bits are just gluing:

  • pass the protocol name as a parameter for have correct logs
  • add the RudderClientRegistrationRepository in the trait because it is now required for both, and change class parameters to match it
  • generalize the user details creation to adapt to both OAuth2 and OIDC case in there respective implementation.

Also correct a pair of unrelated typos.

@fanf fanf requested a review from VinceMacBuche July 21, 2023 10:56
…s/AuthBackendsRepository.scala

Co-authored-by: Alexis Mousset <alexis.mousset@rudder.io>
@Normation-Quality-Assistant
Copy link
Contributor

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit af5ec9f into Normation:branches/rudder/7.3 Jul 27, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants