Skip to content

Commit

Permalink
Add iam specific scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
loafoe committed Jan 27, 2024
1 parent 84e794b commit 86c0de3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions connector/hsdp/extend_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ func (c *HSDPConnector) ExtendPayload(scopes []string, payload []byte, cdata []b
c.logger.Info("ExtendPayload called for user: ", cd.Introspect.Username)

for _, scope := range scopes {
if scope == "federated:id" {
originalClaims["iam_access_token"] = string(cd.AccessToken)
}
// Check if we should use the trusted_tenant scope
if strings.HasPrefix(scope, "trusted_tenant:") {
var tenant string
Expand All @@ -39,7 +36,11 @@ func (c *HSDPConnector) ExtendPayload(scopes []string, payload []byte, cdata []b

// Experimental fill introspect body into claims
if scope == "hsp:iam:introspect" {
originalClaims["introspect"] = cd.Introspect
originalClaims["intr"] = cd.Introspect
}
// Experimental fill token into claims
if scope == "hsp:iam:token" {
originalClaims["tkn"] = string(cd.AccessToken)
}

// Experimental tenant scoping
Expand Down

0 comments on commit 86c0de3

Please sign in to comment.