-
-
Notifications
You must be signed in to change notification settings - Fork 2k
feat: add option to use organization id for preferred username in Google Provider #3237
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
feat: add option to use organization id for preferred username in Google Provider #3237
Conversation
b385f87 to
d539465
Compare
d539465 to
1a32885
Compare
tuunit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run make generate to update the alpha docs
7e82026 to
e73b0c2
Compare
c37d6b6 to
4b6d7a2
Compare
|
@pixeldrew please check the linting issues in the workflow or run make lint locally :) Rest looks good to me, after the linting issues are fixed this is ready to be merged |
596ab79 to
84f4021
Compare
fixed the linting issues and regenerated the docs again, apologies for the rework. |
84f4021 to
be3ac7d
Compare
Signed-off-by: Drew Foehn <drew@pixelburn.net> Signed-off-by: Jan Larwig <jan@larwig.com>
be3ac7d to
bdd2025
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the last lint error myself and adapted the Changelog :)
Thanks for contributing
Description
Google id token uses the google id as username. I have internal systems that the username should match employee id which is my mapped into my google workspace directory as "Organization Id". I needed to have a way to retrieve that and add it to a header as it's not in the id token either.
Motivation and Context
This allows a preferred username to be retrieved from the directory as "organization" id instead of google's user id. This is similar to how you might use MS Entra's onpremid to map to local AD usernames. I added a config change to enable this. If the user does not have an organization id mapped, the auth service will 500, i'm open to changing this behavior.
Due to the way the scope permissions are iterated over, it currently only works if you have both https://www.googleapis.com/auth/admin.directory.group.member.readonly and https://www.googleapis.com/auth/admin.directory.user.readonly.
Made the scope required for AdminApiUser as a config option.
How Has This Been Tested?
Tested locally and in production.
Checklist: