Skip to content

Commit

Permalink
Merge pull request #297 from cadethacker/master
Browse files Browse the repository at this point in the history
add id_token to the user object, set in openid-connect provider
  • Loading branch information
bentranter committed Oct 31, 2019
2 parents 0c61c93 + 470a64a commit fe22ae6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions providers/openidConnect/openidConnect.go
Expand Up @@ -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 (
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions user.go
Expand Up @@ -27,4 +27,5 @@ type User struct {
AccessTokenSecret string
RefreshToken string
ExpiresAt time.Time
IDToken string
}

0 comments on commit fe22ae6

Please sign in to comment.