You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe I am doing something wrong. Or it is a bug. If it is a bug, I can fix it by changing following two functions - making 'state' key and token value not other way around.
(ns friend-oauth2.workflow)
(defn- redirect-to-provider!
"Redirects user to OAuth2 provider. Code should be in response."
[{:keys [uri-config]} request]
(let [anti-forgery-token (util/generate-anti-forgery-token)
session-with-af-token (assoc (:session request) :state anti-forgery-token)]
(-> uri-config
(util/format-authn-uri anti-forgery-token)
ring.util.response/redirect
(assoc :session session-with-af-token))))
(ns friend-oauth2.util)
(defn extract-anti-forgery-token
"Extracts the anti-csrf state key from the response"
[{session :session}]
(:state session))
If the 'state' is in friend's ::identity map, it would be better. Because when logout get called it will be cleared from session by friend's logout function (just a thought, not sure if this is possible).
The text was updated successfully, but these errors were encountered:
Hey, sorry I've been slow to respond. I'm in the process of doing some serious refactoring now and this'll get updated to work in the way you're suggesting as part of it. Will update here when that's in!
Middleware stack:
Symptom - 'token' and 'state' entry in 'session' keep adding up. I.e.,
Maybe I am doing something wrong. Or it is a bug. If it is a bug, I can fix it by changing following two functions - making 'state' key and token value not other way around.
If the 'state' is in friend's ::identity map, it would be better. Because when logout get called it will be cleared from session by friend's logout function (just a thought, not sure if this is possible).
The text was updated successfully, but these errors were encountered: