Also set the username in authproxy connector (#3307)

Signed-off-by: Patrick Pacher <patrick.pacher@gmail.com>
This commit is contained in:
Patrick Pacher
2024-01-26 22:18:08 +01:00
committed by GitHub
parent 9451d87ca0
commit 8e07edc188
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -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,
+2
View File
@@ -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)
}
@@ -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)
}