Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Commit

Permalink
openid works in servlet context
Browse files Browse the repository at this point in the history
  • Loading branch information
kolov committed Mar 29, 2013
1 parent 2bb8807 commit 26ef881
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cemerick/friend.clj
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Equivalent to (complement current-authentication)."}
resp (response/redirect-after-post
(or unauthorized-uri
(and (string? redirect) redirect)
(-> request ::auth-config :default-landing-uri)))]
(str (:context request) (-> request ::auth-config :default-landing-uri ))))]
(if unauthorized-uri
(-> resp
(assoc :session (:session request))
Expand Down
5 changes: 3 additions & 2 deletions src/cemerick/friend/openid.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[cemerick.friend.util :as util]
clojure.walk
ring.util.response
[ring.util.request :as req]
[clojure.core.cache :as cache])
(:use clojure.core.incubator
[cemerick.friend.util :only (gets)])
Expand Down Expand Up @@ -103,8 +104,8 @@
(.setAssociations (InMemoryConsumerAssociationStore.))
(.setNonceVerifier (InMemoryNonceVerifier. (/ max-nonce-age 1000)))))
discovery-cache (atom (cache/ttl-cache-factory {} :ttl max-nonce-age))]
(fn [{:keys [uri request-method params] :as request}]
(when (= uri openid-uri)
(fn [{:keys [ request-method params] :as request}]
(when (= (req/path-info request) openid-uri)
(let [params (clojure.walk/stringify-keys params)
user-identifier (and (= request-method :post)
(get params (name user-identifier-param)))]
Expand Down

0 comments on commit 26ef881

Please sign in to comment.