-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[idp] Add email to ID token #17678
[idp] Add email to ID token #17678
Conversation
Identities: []*protocol.Identity{ | ||
nil, | ||
{Deleted: true, PrimaryEmail: "[email protected]"}, | ||
{PrimaryEmail: "[email protected]"}, |
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.
{PrimaryEmail: "[email protected]"}, | |
{Deleted: false, PrimaryEmail: "[email protected]"}, |
I know it's the default, but visually grepping the tests the symmetry makes it easier
@@ -79,6 +88,9 @@ func (srv *IdentityProviderService) GetIDToken(ctx context.Context, req *connect | |||
userInfo := oidc.NewUserInfo() | |||
userInfo.SetName(user.Name) | |||
userInfo.SetSubject(subject) | |||
if email != "" { |
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.
You could drop the if
, it would set it to the empty string, which is the default value in the struct anyway - it's omitempty in the JSON struct
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.
Indeed. I like the explicitness of this code though :)
which is a valid claim because it's verified by the original IDP, and this is not the user-editable value.
Description
This PR adds the
email
claim to the ID tokens produced by the IDP feature.Related Issue(s)
Fixes #17530
How to test
see unit tests or
gp idp token
Documentation
Preview status
Gitpod was successfully deployed to your preview environment.
Build Options:
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish Options
Installer Options
Add desired feature flags to the end of the line above, space separated
Preview Environment Options:
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
/hold