Special case to extract email when using Google IAP as authenticating proxy

This commit is contained in:
Daniel Lundin
2019-10-03 19:38:46 +02:00
parent 4a072f69ac
commit db17aa8032
+4
View File
@@ -339,6 +339,10 @@ func (s *Server) userFromHeader(handler http.Handler) http.Handler {
user = "anonymous"
}
if *authUserHeader == "X-Goog-Authenticated-User-Email" {
user = strings.TrimPrefix(user, "accounts.google.com:")
}
cookie := http.Cookie{
Name: "wguser",
Value: user,