git.iko.soy/typeable/oauth2-proxy
on master help sign in
Log the difference between invalid email and not authorized session (#2010)
5d60177Ole-Martin Bratteng
CHANGELOG.md+1
@@ -16,6 +16,7 @@
16- [#1927](https://github.com/oauth2-proxy/oauth2-proxy/pull/1927) Fix default scope settings for none oidc providers
16- [#1927](https://github.com/oauth2-proxy/oauth2-proxy/pull/1927) Fix default scope settings for none oidc providers
17- [#1951](https://github.com/oauth2-proxy/oauth2-proxy/pull/1951) Fix validate URL, check if query string marker (?) or separator (&) needs to be appended (@miguelborges99)
17- [#1951](https://github.com/oauth2-proxy/oauth2-proxy/pull/1951) Fix validate URL, check if query string marker (?) or separator (&) needs to be appended (@miguelborges99)
18- [#1920](https://github.com/oauth2-proxy/oauth2-proxy/pull/1920) Make sure emailClaim is not overriden if userIDClaim is not set
18- [#1920](https://github.com/oauth2-proxy/oauth2-proxy/pull/1920) Make sure emailClaim is not overriden if userIDClaim is not set
19+- [#2010](https://github.com/oauth2-proxy/oauth2-proxy/pull/2010) Log the difference between invalid email and not authorized session
19- [#1988](https://github.com/oauth2-proxy/oauth2-proxy/pull/1988) Ensure sign-in page background is uniform throughout the page
20- [#1988](https://github.com/oauth2-proxy/oauth2-proxy/pull/1988) Ensure sign-in page background is uniform throughout the page
20
21
21# V7.4.0
22# V7.4.0
oauthproxy.go+6−1
@@ -1056,7 +1056,12 @@ func (p *OAuthProxy) getAuthenticatedSession(rw http.ResponseWriter, req *http.R
1056 }
1056 }
1057
1057
1058 if invalidEmail || !authorized {
1058 if invalidEmail || !authorized {
1059+ cause := "unauthorized"
1060+ if invalidEmail {
1061+ cause = "invalid email"
1062+ }
1063+
1059− logger.PrintAuthf(session.Email, req, logger.AuthFailure, "Invalid authorization via session: removing session %s", session)
1064+ logger.PrintAuthf(session.Email, req, logger.AuthFailure, "Invalid authorization via session (%s): removing session %s", cause, session)
1060 // Invalid session, clear it
1065 // Invalid session, clear it
1061 err := p.ClearSessionCookie(rw, req)
1066 err := p.ClearSessionCookie(rw, req)
1062 if err != nil {
1067 if err != nil {