Skip to content

Commit e9d852a

Browse files
mdariiMaxim Darii
authored andcommitted
use array per RFC 7519 if Audiences provided
1 parent be711be commit e9d852a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

jwt/jwt.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,8 @@ func (js jwtSource) Token() (*oauth2.Token, error) {
128128

129129
// Handle audience per RFC 7519: single string or array of strings
130130
if len(js.conf.Audiences) > 0 {
131-
// Use new Audiences field (takes precedence)
132-
if len(js.conf.Audiences) == 1 {
133-
// Single audience: use string per RFC 7519
134-
claimSet.Aud = js.conf.Audiences[0]
135-
} else {
136-
// Multiple audiences: use array per RFC 7519
137-
claimSet.Aud = js.conf.Audiences
138-
}
131+
// Multiple audiences: use array per RFC 7519
132+
claimSet.Aud = js.conf.Audiences
139133
} else if aud := js.conf.Audience; aud != "" {
140134
// Use legacy Audience field for backward compatibility
141135
claimSet.Aud = aud

0 commit comments

Comments
 (0)