git.iko.soy/typeable/oauth2-proxy
on master help sign in
Log the difference between invalid email and not authorized session (#2010)

* Log the difference between invalid email and not authorized session * Add changelog entry * Remove superfluous argument --------- Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>

commit5d60177d3e38f46fbfc7a641205967c4752d7d9c authorOle-Martin Bratteng <1681525+omBratteng@users.noreply.github.com> dateSun 5 Mar 2023, 19:28 (4 years ago) parent487a0a5
2 files changed+7−1
CHANGELOG.md+1 oauthproxy.go+6−1
CHANGELOG.md+1
@@ -16,6 +16,7 @@
1616- [#1927](https://github.com/oauth2-proxy/oauth2-proxy/pull/1927) Fix default scope settings for none oidc providers
1717- [#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)
1818- [#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
1920- [#1988](https://github.com/oauth2-proxy/oauth2-proxy/pull/1988) Ensure sign-in page background is uniform throughout the page
2021
2122# V7.4.0
oauthproxy.go+6−1
@@ -1056,7 +1056,12 @@ func (p *OAuthProxy) getAuthenticatedSession(rw http.ResponseWriter, req *http.R
10561056 }
10571057
10581058 if invalidEmail || !authorized {
1059− logger.PrintAuthf(session.Email, req, logger.AuthFailure, "Invalid authorization via session: removing session %s", session)
1059+ cause := "unauthorized"
1060+ if invalidEmail {
1061+ cause = "invalid email"
1062+ }
1063+
1064+ logger.PrintAuthf(session.Email, req, logger.AuthFailure, "Invalid authorization via session (%s): removing session %s", cause, session)
10601065 // Invalid session, clear it
10611066 err := p.ClearSessionCookie(rw, req)
10621067 if err != nil {