Permalink
Browse files

Support openid4java stateless mode, fixes gh-35

  • Loading branch information...
1 parent 71ab55f commit 5c3e74324e0ad10c73beb19f75913605bc930b61 Tobias Steiner committed Nov 25, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/cemerick/friend/openid.clj
@@ -92,14 +92,15 @@
(defn workflow
[& {:keys [openid-uri credential-fn user-identifier-param max-nonce-age
- login-failure-handler realm]
+ login-failure-handler realm consumer-manager]
:or {openid-uri "/openid"
user-identifier-param "identifier"
max-nonce-age 60000}
:as openid-config}]
- (let [mgr (doto (ConsumerManager.)
- (.setAssociations (InMemoryConsumerAssociationStore.))
- (.setNonceVerifier (InMemoryNonceVerifier. (/ max-nonce-age 1000))))
+ (let [mgr (or consumer-manager
+ (doto (ConsumerManager.)
+ (.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)

0 comments on commit 5c3e743

Please sign in to comment.