mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-01-06 13:36:54 +00:00
PR feedback-- omit empty groups, keep groups as nil until last minute
Also log keys and values for claims
This commit is contained in:
@@ -102,12 +102,12 @@ func (p *ProviderConfig) ValidateToken(ctx context.Context, tok *oauth2.Token, e
|
||||
if err := validated.Claims(&validatedClaims); err != nil {
|
||||
return nil, httperr.Wrap(http.StatusInternalServerError, "could not unmarshal id token claims", err)
|
||||
}
|
||||
plog.All("claims from ID token", "providerName", p.Name, "claims", listClaims(validatedClaims))
|
||||
plog.All("claims from ID token", "providerName", p.Name, "claims", validatedClaims)
|
||||
|
||||
if err := p.fetchUserInfo(ctx, tok, validatedClaims); err != nil {
|
||||
return nil, httperr.Wrap(http.StatusInternalServerError, "could not fetch user info claims", err)
|
||||
}
|
||||
plog.All("claims from ID token and userinfo", "providerName", p.Name, "claims", listClaims(validatedClaims))
|
||||
plog.All("claims from ID token and userinfo", "providerName", p.Name, "claims", validatedClaims)
|
||||
|
||||
return &oidctypes.Token{
|
||||
AccessToken: &oidctypes.AccessToken{
|
||||
@@ -162,13 +162,3 @@ func (p *ProviderConfig) fetchUserInfo(ctx context.Context, tok *oauth2.Token, c
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func listClaims(claims map[string]interface{}) []string {
|
||||
list := make([]string, len(claims))
|
||||
i := 0
|
||||
for claim := range claims {
|
||||
list[i] = claim
|
||||
i++
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user