-
Notifications
You must be signed in to change notification settings - Fork 123
setting redirect to false fails to touch the session #83
Comments
My dirty hack, a clone of authenticate: (defn authenticate [ring-handler auth-config]
(fn [request]
(let [response-or-handler-map (friend/authenticate-request request
auth-config)
response (if-let [handler-map (:friend/handler-map
response-or-handler-map)]
(friend/handler-request ring-handler handler-map)
response-or-handler-map)
response (friend/authenticate-response response request)]
(if (json/json-login-route? (merge request {::friend/auth-config
{:login-uri default-login-uri}}))
(assoc response
:session (-> response-or-handler-map
:friend/ensure-identity-request
:session))
response)))) |
OK, where does the |
Yes, in the basic Compojure style. I implemented POST and GET methods Chas Emerick wrote:
Sam Ritchie (@sritchie) |
Yup, I agree, just making sure I'm grokking your setup properly. I think you're the first person to impl a workflow that returns non-redirecting auths. Congrats. ;-P Hoping to have a fix this week, going to take a little bit to add some more tests and make sure the matrix of possibilities is covered. |
I wonder if this is similar to my own use-case here: http://stackoverflow.com/questions/20273190/use-friend-for-authentication-and-authorisation-in-a-single-page-clojure-web-app My interest is precisely in not using any redirects when authenticating in my single-page web application. |
Sounds plausible. Both this and #82 are blocking on my properly revisiting the issue of relative redirects, spec compliance of the same, etc. I'd like to try to make things work properly and be compliant, rather than stacking on an option for such a bit of trivia. |
I am also very interested in using Friend with a single page web app, in my case Ember.js rather than Angular. I'd like to use RFC 6749 (OAuth 2.0), specifically the "Resource Owner Password Credentials Grant Type", which is described here: https://github.com/simplabs/ember-simple-auth#the-rfc-6749-oauth-20-authenticator . I don't know enough clojure to work on a PR for this, but thought I would mention that this would make clojure a very attractive option for the server backend of Ember apps. |
Also interest here to use in spa - json api / no redirects. |
allows a workflow to request no redirects *and* that the session should be set. Fixes gh-83.
Redirecting and touching the session are orthogonal, so options are now provided for both. A new |
as discussed on irc: https://gist.github.com/sritchie/7552129
The text was updated successfully, but these errors were encountered: