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

Also set the username in authproxy connector #3307

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions connector/authproxy/authproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ func (m *callback) HandleCallback(s connector.Scopes, r *http.Request) (connecto
}
return connector.Identity{
UserID: remoteUserID,
Username: remoteUser,
PreferredUsername: remoteUser,
Email: remoteUserEmail,
EmailVerified: true,
Expand Down
2 changes: 2 additions & 0 deletions connector/authproxy/authproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func TestUser(t *testing.T) {
// If not specified, the userID and email should fall back to the remote user
expectEquals(t, ident.UserID, testUsername)
expectEquals(t, ident.PreferredUsername, testUsername)
expectEquals(t, ident.Username, testUsername)
expectEquals(t, ident.Email, testUsername)
expectEquals(t, len(ident.Groups), 0)
}
Expand Down Expand Up @@ -74,6 +75,7 @@ func TestExtraHeaders(t *testing.T) {

expectEquals(t, ident.UserID, testUserID)
expectEquals(t, ident.PreferredUsername, testUsername)
expectEquals(t, ident.Username, testUsername)
expectEquals(t, ident.Email, testEmail)
expectEquals(t, len(ident.Groups), 0)
}
Expand Down
Loading