diff --git a/connector/authproxy/authproxy.go b/connector/authproxy/authproxy.go index 7b089818b7..465c3e3d9e 100644 --- a/connector/authproxy/authproxy.go +++ b/connector/authproxy/authproxy.go @@ -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, diff --git a/connector/authproxy/authproxy_test.go b/connector/authproxy/authproxy_test.go index 1f234d9a8d..5e09872299 100644 --- a/connector/authproxy/authproxy_test.go +++ b/connector/authproxy/authproxy_test.go @@ -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) }