You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-06-21 00:29:44 +02:00
Strip JWT base64 padding before parsing. #560
This commit is contained in:
@ -67,7 +67,8 @@ func emailFromIdToken(idToken string) (string, error) {
|
|||||||
// id_token is a base64 encode ID token payload
|
// id_token is a base64 encode ID token payload
|
||||||
// https://developers.google.com/accounts/docs/OAuth2Login#obtainuserinfo
|
// https://developers.google.com/accounts/docs/OAuth2Login#obtainuserinfo
|
||||||
jwt := strings.Split(idToken, ".")
|
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 {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user