Hi,

I am trying to setup my authentication using cemerick/friend. I would like 
to authenticate using openid with gmail. 

Below is the code that I have - 

(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 "/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
       {:workflows [(openid/workflow :openid-uri 
"https://www.google.com/accounts/o8/id"; :realm "http://invoize.com";)]})))

(def app
  (handler/site app-routes))

My expectation is that when I try to access the "/index" or "/landing" url, 
it should not allow me as I am not authenticated and redirect to the 
openid-url,however this does not happen. How do I achieve it ?

Thanks,
Murtaza

-- 
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