The parameter name is 'identifier' (not 'openid_identifier') by default (which 
you can customize if you want by specifying a :user-identifier-param option in 
openid/workflow).

That said, the NPE you just hit has drawn my attention to an (unrelated) bug in 
the openid workflow.  Thanks! :-)

- Chas

On Dec 19, 2012, at 1:20 PM, Murtaza Husain wrote:

> 
> Thanks for catching that Aaron !
> 
> The app currently redirects to the login page now. However I get an error 
> when I try to post to the "/openid" url with 
> {"openid_identifier":"https://www.google.com/accounts/o8/id"} as post data.
> 
> Here is the updated code - 
> 
> (ns faiz.handler
>   (:use compojure.core)
>   (:require [compojure.handler :as handler]
>             [compojure.route :as route]
>             [ring.util.response :as resp]
>             [me.shenfeng.mustache :as mustache]
>             [cemerick.friend :as friend]
>             (cemerick.friend [workflows :as workflows]
>                              [credentials :as creds]
>                              [openid :as openid])))
> 
> (mustache/deftemplate index (slurp "public/index-async.html"))
> 
> (def index-data {:title "Invoize." :brand "Faiz" :links [{:url "#/students" 
> :text "Students"} {:url "#/thaalis" :text "Thaalis"}]})
> 
> (defroutes app-routes
>   (GET "/" [] (resp/redirect "/login"))
>   (ANY "/login" [] (resp/file-response "landing.html" {:root "public"}))
>   (GET "/landing" [] (resp/file-response "landing.html" {:root "public"}))
>   (GET "/index" [] (friend/authenticated (index index-data)))
>   (route/files "/" {:root "public"})
>   (route/not-found "Not Found"))
> 
> (def app-routes-with-auth
>   (-> app-routes
>       (friend/authenticate
>        {:workflows [(openid/workflow :openid-uri "/openid" :realm 
> "http://invoize.com"; :credential-fn identity)]})))
> 
> (def app
>   (handler/site app-routes-with-auth))
> 
> 
> Below is the stacktrace -
> 
> java.lang.NullPointerException
> 
> openid.clj:124        cemerick.friend.openid/workflow[fn]
> friend.clj:174        cemerick.friend/authenticate*[fn]
> core.clj:2432 clojure.core/map[fn]
> LazySeq.java:42       clojure.lang.LazySeq.sval
> 
> 
> Thanks,
> Murtaza
> 
> 
> 
> 
> On Wednesday, December 19, 2012 7:37:04 PM UTC+5:30, Aaron Cohen wrote:
> 
> 
> 
> On Wed, Dec 19, 2012 at 8:40 AM, Murtaza Husain <murtaza...@sevenolives.com> 
> wrote:
> (defroutes app-routes
>   (GET "/" [] (resp/redirect "/landing"))
>   (GET "/landing" [] (resp/file-response "landing.html" {:root "public"}))
>   (GET "/index" [] (index index-data))
>   (route/files "/" {:root "public"})
>   (route/not-found "Not Found"))
> 
> (def mock-app
>   (-> app-routes
>       (friend/authenticate
>        {:allow-anon? false
>         :login-uri? "/landing"
>         :workflows [(openid/workflow :openid-uri "/openid" :realm 
> "http://invoize.com";)]})))
> 
> 
> 
> I'm not fully conversant with all the libraries, but don't you actually need 
> to use mock-app somewhere?
>  
> (def app
>   (handler/site app-routes))
> 
> 
> -- 
> 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 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

Reply via email to