mirror of
https://github.com/netbirdio/dex.git
synced 2026-05-22 18:43:53 -07:00
Also set the username in authproxy connector (#3307)
Signed-off-by: Patrick Pacher <patrick.pacher@gmail.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user