Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

openid works in servlet context

  • Loading branch information...
commit 26ef881b1976ad7b5b2bafce143f96a245defa2a 1 parent 2bb8807
@kolov kolov authored
Showing with 4 additions and 3 deletions.
  1. +1 −1  src/cemerick/friend.clj
  2. +3 −2 src/cemerick/friend/openid.clj
View
2  src/cemerick/friend.clj
@@ -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))
View
5 src/cemerick/friend/openid.clj
@@ -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)])
@@ -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)))]
Please sign in to comment.
Something went wrong with that request. Please try again.