From 470a64af42c05c9d773631d9594e28d8badec22b Mon Sep 17 00:00:00 2001 From: Cade Thacker Date: Thu, 31 Oct 2019 16:59:09 -0400 Subject: [PATCH] add id_token to the user object, set in openid-connect provider --- providers/openidConnect/openidConnect.go | 6 ++++-- user.go | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/providers/openidConnect/openidConnect.go b/providers/openidConnect/openidConnect.go index a4ff1d40f..b1f8dd384 100644 --- a/providers/openidConnect/openidConnect.go +++ b/providers/openidConnect/openidConnect.go @@ -6,12 +6,13 @@ import ( "encoding/json" "errors" "fmt" - "github.com/markbates/goth" - "golang.org/x/oauth2" "io/ioutil" "net/http" "strings" "time" + + "github.com/markbates/goth" + "golang.org/x/oauth2" ) const ( @@ -173,6 +174,7 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { RefreshToken: sess.RefreshToken, ExpiresAt: expiresAt, RawData: claims, + IDToken: sess.IDToken, } p.userFromClaims(claims, &user) diff --git a/user.go b/user.go index 1d6a41963..0cc583051 100644 --- a/user.go +++ b/user.go @@ -27,4 +27,5 @@ type User struct { AccessTokenSecret string RefreshToken string ExpiresAt time.Time + IDToken string }