fix: unmarshalling of scopes in access token (#327)

The Scopes field in accessTokenClaims should be a  SpaceDelimitedArray,
in order to allow for correct unmarshalling.

Fixes #318

* adjust test data
This commit is contained in:
Tim Möhlmann 2023-03-15 15:44:49 +02:00 committed by GitHub
parent 0f3d4f4828
commit c6820ba88a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View file

@ -13,10 +13,7 @@
"some", "some",
"methods" "methods"
], ],
"scope": [ "scope": "email phone",
"email",
"phone"
],
"client_id": "777", "client_id": "777",
"exp": 12345, "exp": 12345,
"iat": 12000, "iat": 12000,

View file

@ -97,7 +97,7 @@ func (c *TokenClaims) SetSignatureAlgorithm(algorithm jose.SignatureAlgorithm) {
type AccessTokenClaims struct { type AccessTokenClaims struct {
TokenClaims TokenClaims
Scopes []string `json:"scope,omitempty"` Scopes SpaceDelimitedArray `json:"scope,omitempty"`
Claims map[string]any `json:"-"` Claims map[string]any `json:"-"`
} }