Skip to content
This repository
Browse code

Support openid4java stateless mode, fixes gh-35

  • Loading branch information...
commit 5c3e74324e0ad10c73beb19f75913605bc930b61 1 parent 71ab55f
Tobias Steiner authored

Showing 1 changed file with 5 additions and 4 deletions. Show diff stats Hide diff stats

  1. +5 4 src/cemerick/friend/openid.clj
9 src/cemerick/friend/openid.clj
@@ -92,14 +92,15 @@
92 92
93 93 (defn workflow
94 94 [& {:keys [openid-uri credential-fn user-identifier-param max-nonce-age
95   - login-failure-handler realm]
  95 + login-failure-handler realm consumer-manager]
96 96 :or {openid-uri "/openid"
97 97 user-identifier-param "identifier"
98 98 max-nonce-age 60000}
99 99 :as openid-config}]
100   - (let [mgr (doto (ConsumerManager.)
101   - (.setAssociations (InMemoryConsumerAssociationStore.))
102   - (.setNonceVerifier (InMemoryNonceVerifier. (/ max-nonce-age 1000))))
  100 + (let [mgr (or consumer-manager
  101 + (doto (ConsumerManager.)
  102 + (.setAssociations (InMemoryConsumerAssociationStore.))
  103 + (.setNonceVerifier (InMemoryNonceVerifier. (/ max-nonce-age 1000)))))
103 104 discovery-cache (atom (cache/ttl-cache-factory {} :ttl max-nonce-age))]
104 105 (fn [{:keys [uri request-method params] :as request}]
105 106 (when (= uri openid-uri)

0 comments on commit 5c3e743

Please sign in to comment.
Something went wrong with that request. Please try again.