Unable to Authenticate via Friend + Interactive Form Workflow

2013-02-20 Thread Ari
Hi,

I'm trying to incorporate authentication via the interactive form workflow; 
however, I'm currently unable to receive submitted credentials for 
verification. When I submit the sign-in form that has it's action bound to 
/login, I get Page not found as per my default route below. I've 
included the relevant code below; does anyone see anything wrong? 

Note: For the first go-around I opted for a dummy in-memory user db. I'm 
also using compojure, ring-anti-forgery and shoreleave-remote.

(defroutes paths
  (GET /home [] (friend/authorize #{::user} views/home))
  (GET / [] (views/welcome))
  (friend/logout (ANY /sign-out request (ring.util.response/redirect 
/)))
  (route/resources /)
  (route/not-found Page not found))

(def app
  (- paths
  (friend/authenticate {:credential-fn (partial 
credentials/bcrypt-credential-fn users)
:workflows [(workflows/interactive-form)]
:login-uri /})
  (wrap-anti-forgery)  
  (wrap-rpc)
  (handler/site)))

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Unable to Authenticate via Friend + Interactive Form Workflow

2013-02-20 Thread Nelson Morris
On Wed, Feb 20, 2013 at 2:48 PM, Ari ari.brandeis.k...@gmail.com wrote:
 Hi,

 I'm trying to incorporate authentication via the interactive form workflow;
 however, I'm currently unable to receive submitted credentials for
 verification. When I submit the sign-in form that has it's action bound to
 /login, I get Page not found as per my default route below. I've
 included the relevant code below; does anyone see anything wrong?

 Note: For the first go-around I opted for a dummy in-memory user db. I'm
 also using compojure, ring-anti-forgery and shoreleave-remote.

 (defroutes paths
   (GET /home [] (friend/authorize #{::user} views/home))
   (GET / [] (views/welcome))
   (friend/logout (ANY /sign-out request (ring.util.response/redirect
 /)))
   (route/resources /)
   (route/not-found Page not found))

 (def app
   (- paths
   (friend/authenticate {:credential-fn (partial
 credentials/bcrypt-credential-fn users)
 :workflows [(workflows/interactive-form)]
 :login-uri /})
   (wrap-anti-forgery)
   (wrap-rpc)
   (handler/site)))

Passing a :login-uri causes workflows/interactive-from to change what
uri it checks for.  Given the setup above the login form needs to post
to /.

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Unable to Authenticate via Friend + Interactive Form Workflow

2013-02-20 Thread Ilshad Khabibullin
Hi Ari,

you have to add wrappers:

ring.middleware.params/wrap-parms
ring.middleware.keyword-params/wrap-keyword-params


---
Ilshad Khabibullin
+7 981 688 26 35





On Feb 21, 2013, at 12:48 AM, Ari ari.brandeis.k...@gmail.com wrote:

 Hi,
 
 I'm trying to incorporate authentication via the interactive form workflow; 
 however, I'm currently unable to receive submitted credentials for 
 verification. When I submit the sign-in form that has it's action bound to 
 /login, I get Page not found as per my default route below. I've included 
 the relevant code below; does anyone see anything wrong? 
 
 Note: For the first go-around I opted for a dummy in-memory user db. I'm also 
 using compojure, ring-anti-forgery and shoreleave-remote.
 
 (defroutes paths
   (GET /home [] (friend/authorize #{::user} views/home))
   (GET / [] (views/welcome))
   (friend/logout (ANY /sign-out request (ring.util.response/redirect /)))
   (route/resources /)
   (route/not-found Page not found))
 
 (def app
   (- paths
   (friend/authenticate {:credential-fn (partial 
 credentials/bcrypt-credential-fn users)
 :workflows [(workflows/interactive-form)]
 :login-uri /})
   (wrap-anti-forgery)  
   (wrap-rpc)
   (handler/site)))
 
 -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Unable to Authenticate via Friend + Interactive Form Workflow

2013-02-20 Thread Ilshad Khabibullin
Ah, thanks.

On Feb 21, 2013, at 1:42 AM, larry google groups lawrencecloj...@gmail.com 
wrote:

  ring.middleware.params/wrap-parms
  ring.middleware.keyword-params/wrap-keyword-params
 
 No, he already has: 
 
   (handler/site))
 
 Which should add in the middleware that you mention. But in my app I have: 
 
 handler/site)
 
 instead of:
 
 (handler/site))
 
 I think it gets rolled up and called at the end, so I am not sure the parens 
 are needed. 
 
 
 
 
 On Wednesday, February 20, 2013 4:14:29 PM UTC-5, Ilshad Khabibullin wrote:
 Hi Ari,
 
 you have to add wrappers:
 
 ring.middleware.params/wrap-parms
 ring.middleware.keyword-params/wrap-keyword-params
 
 
 ---
 Ilshad Khabibullin
 +7 981 688 26 35
 
 
 
 
 
 On Feb 21, 2013, at 12:48 AM, Ari ari.bran...@gmail.com wrote:
 
 Hi,
 
 I'm trying to incorporate authentication via the interactive form workflow; 
 however, I'm currently unable to receive submitted credentials for 
 verification. When I submit the sign-in form that has it's action bound to 
 /login, I get Page not found as per my default route below. I've 
 included the relevant code below; does anyone see anything wrong? 
 
 Note: For the first go-around I opted for a dummy in-memory user db. I'm 
 also using compojure, ring-anti-forgery and shoreleave-remote.
 
 (defroutes paths
   (GET /home [] (friend/authorize #{::user} views/home))
   (GET / [] (views/welcome))
   (friend/logout (ANY /sign-out request (ring.util.response/redirect /)))
   (route/resources /)
   (route/not-found Page not found))
 
 (def app
   (- paths
   (friend/authenticate {:credential-fn (partial 
 credentials/bcrypt-credential-fn users)
 :workflows [(workflows/interactive-form)]
 :login-uri /})
   (wrap-anti-forgery)  
   (wrap-rpc)
   (handler/site)))
 
 -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.com
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+u...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  
 
 
 -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Unable to Authenticate via Friend + Interactive Form Workflow

2013-02-20 Thread Ari


 Passing a :login-uri causes workflows/interactive-from to change what 
 uri it checks for.  Given the setup above the login form needs to post 
 to /. 


I was under the impression that the :login-uri was on for only getting the 
form. Do you know if the GET and POST uris can be separated via 
configuration?

Also, if the username is an email address authentication, in spite of 
correct credentials, fails. Anyone know why that is? Thanks.

-Ari

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.