Skip to content

Commit

Permalink
flatten the audience #185
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Apr 5, 2023
1 parent 26ca8ab commit f88f07e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/apiclient/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ func generateJWT(privateKey string) (string, error) {
}

now := time.Now()
token := jwt.New()

//Google OAuth takes aud as a string, not array
//ref: https://github.com/lestrrat-go/jwx/releases/tag/v2.0.7
jwt.Settings(jwt.WithFlattenAudience(true))
token := jwt.New()
token.Options().IsEnabled(jwt.FlattenAudience)

_ = token.Set("aud", tokenUri)
_ = token.Set(jwt.IssuerKey, getServiceAccountProperty("ClientEmail"))
Expand Down

0 comments on commit f88f07e

Please sign in to comment.