Skip to content

Commit

Permalink
Also set the username in authproxy connector (#3307)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Pacher <patrick.pacher@gmail.com>
  • Loading branch information
ppacher committed Jan 26, 2024
1 parent 9451d87 commit 8e07edc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions connector/authproxy/authproxy.go
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
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

0 comments on commit 8e07edc

Please sign in to comment.