From c33edb395b94e68a37e9cc7dd1c198da8ea5e724 Mon Sep 17 00:00:00 2001 From: Andy Lo-A-Foe Date: Sat, 20 May 2023 07:43:29 +0200 Subject: [PATCH] Add username claim --- connector/hsdp/extend_payload.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/connector/hsdp/extend_payload.go b/connector/hsdp/extend_payload.go index 16b7a7d871..b088d8dd39 100644 --- a/connector/hsdp/extend_payload.go +++ b/connector/hsdp/extend_payload.go @@ -60,6 +60,10 @@ func (c *HSDPConnector) ExtendPayload(scopes []string, payload []byte, cdata []b if cd.User.GivenName != "" { originalClaims["name"] = fmt.Sprintf("%s %s", cd.User.GivenName, cd.User.FamilyName) } + // Inject username + if cd.Introspect.Username != "" { + originalClaims["username"] = cd.Introspect.Username + } if len(orgSubs) > 0 { subs := strings.Join(orgSubs, ":") origSub := originalClaims["sub"].(string)