git.iko.soy/typeable/oauth2-proxy
on master help sign in
Fall back to using sub if email is none (as in PR #57)
commit58b06ce761e0b706c9ba7e3081aa0441e75527de authorBrian Van Klaveren <bvan@slac.stanford.edu> dateWed 1 May 2019, 09:22 (7 years ago) parent79acef9
1 file changed+2−1
oauthproxy.go+2−1
oauthproxy.go+2−1
@@ -901,6 +901,7 @@ func (p *OAuthProxy) GetJwtSession(req *http.Request) (*sessionsapi.SessionState
901901 }
902902
903903 var claims struct {
904+ Subject string `json:"sub"`
904905 Email string `json:"email"`
905906 Verified *bool `json:"email_verified"`
906907 }
@@ -910,7 +911,7 @@ func (p *OAuthProxy) GetJwtSession(req *http.Request) (*sessionsapi.SessionState
910911 }
911912
912913 if claims.Email == "" {
913− return nil, fmt.Errorf("id_token did not contain an email")
914+ claims.Email = claims.Subject
914915 }
915916
916917 if claims.Verified != nil && !*claims.Verified {