Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
Merge pull request #561 from danopia/patch-1
Browse files Browse the repository at this point in the history
Strip JWT base64 padding before parsing. #560
  • Loading branch information
jehiah authored Mar 25, 2018
2 parents ae78840 + 542ef54 commit 1c1db88
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion providers/google.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ func emailFromIdToken(idToken string) (string, error) {
// id_token is a base64 encode ID token payload
// https://developers.google.com/accounts/docs/OAuth2Login#obtainuserinfo
jwt := strings.Split(idToken, ".")
b, err := base64.RawURLEncoding.DecodeString(jwt[1])
jwtData := strings.TrimSuffix(jwt[1], "=")
b, err := base64.RawURLEncoding.DecodeString(jwtData)
if err != nil {
return "", err
}
Expand Down

0 comments on commit 1c1db88

Please sign in to comment.