diff --git a/ideas.txt b/ideas.txt deleted file mode 100644 index 3164686..0000000 --- a/ideas.txt +++ /dev/null @@ -1,6 +0,0 @@ -Ideas: - - Save Access Token and Refresh Token in Cache (Redis?) - - Save guid (state), which is the index for the tokens in the cache, as cookie - - Every request verify if access token is valid, otherwise request new one - - Success, all fine - - Failure, redirect to logins diff --git a/pkg/httphandler/callback.go b/pkg/httphandler/callback.go index e525681..7918a4d 100644 --- a/pkg/httphandler/callback.go +++ b/pkg/httphandler/callback.go @@ -38,8 +38,8 @@ func (root *HttpHandler) callbackHandler(w http.ResponseWriter, r *http.Request, http.SetCookie(w, root.forwardAuth.ClearCSRFCookie(root.options)) http.SetCookie(w, root.forwardAuth.MakeAuthCookie(root.options, authResult)) - if len(authResult.RefreshToken) > 0 { // Do we have an refresh token? - http.SetCookie(w, root.forwardAuth.MakeRefreshAuthCookie(root.options, authResult)) - } + //if len(authResult.RefreshToken) > 0 { // Do we have an refresh token? + // http.SetCookie(w, root.forwardAuth.MakeRefreshAuthCookie(root.options, authResult)) + //} http.Redirect(w, r, redirect, http.StatusTemporaryRedirect) } diff --git a/pkg/httphandler/root.go b/pkg/httphandler/root.go index f43716b..9ccdd22 100644 --- a/pkg/httphandler/root.go +++ b/pkg/httphandler/root.go @@ -21,11 +21,11 @@ func (root *HttpHandler) rootHandler(w http.ResponseWriter, r *http.Request, for logger.Warn("IsAuthenticated failed, initating login flow.") http.SetCookie(w, root.forwardAuth.ClearAuthCookie(root.options)) - http.SetCookie(w, root.forwardAuth.ClearRefreshAuthCookie(root.options)) + //http.SetCookie(w, root.forwardAuth.ClearRefreshAuthCookie(root.options)) state := uuid.New().String() http.SetCookie(w, root.forwardAuth.MakeCSRFCookie(w, r, root.options, state)) - http.Redirect(w, r, root.forwardAuth.OAuth2Config.AuthCodeURL(state), http.StatusTemporaryRedirect) + //http.Redirect(w, r, root.forwardAuth.OAuth2Config.AuthCodeURL(state), http.StatusTemporaryRedirect) return }