Authn: resolve issues with setting up a nil identity (#92620)

This commit is contained in:
Charandas
2024-08-29 00:49:41 +03:00
committed by GitHub
parent 692280cd32
commit 4f024d94d8
7 changed files with 71 additions and 44 deletions
+5
View File
@@ -74,10 +74,15 @@ type Identity struct {
// IDToken is a signed token representing the identity that can be forwarded to plugins and external services.
IDToken string
IDTokenClaims *authn.Claims[authn.IDTokenClaims]
AccessTokenClaims *authn.Claims[authn.AccessTokenClaims]
}
// Access implements claims.AuthInfo.
func (i *Identity) GetAccess() claims.AccessClaims {
if i.AccessTokenClaims != nil {
return authn.NewAccessClaims(*i.AccessTokenClaims)
}
return &identity.IDClaimsWrapper{Source: i}
}