From 9dd27cc44e7db675865e53b6faa85492f2e44ea2 Mon Sep 17 00:00:00 2001 From: Frank He Date: Thu, 7 Mar 2019 22:22:33 -0800 Subject: [PATCH] Add optional PrivateClaims to jwt.Config --- jwt/jwt.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jwt/jwt.go b/jwt/jwt.go index 99f3e0a..6d5fd61 100644 --- a/jwt/jwt.go +++ b/jwt/jwt.go @@ -66,6 +66,9 @@ type Config struct { // request. If empty, the value of TokenURL is used as the // intended audience. Audience string + + // PrivateClaims optionally specifies private claims in the JWT. + PrivateClaims map[string]interface{} } // TokenSource returns a JWT TokenSource using the configuration @@ -100,6 +103,7 @@ func (js jwtSource) Token() (*oauth2.Token, error) { Iss: js.conf.Email, Scope: strings.Join(js.conf.Scopes, " "), Aud: js.conf.TokenURL, + PrivateClaims: js.conf.PrivateClaims, } if subject := js.conf.Subject; subject != "" { claimSet.Sub = subject