Liking cljdoc? Tell your friends :D

flybot.oie.core


get-identityclj

(get-identity req)

Extract the authenticated identity from the request.

Extract the authenticated identity from the request.
sourceraw docstring

wrap-authenticateclj

(wrap-authenticate handler strategies)
(wrap-authenticate handler strategies {:keys [allow-anonymous?]})

Ring middleware that tries each strategy in order. Each strategy's :authenticate fn returns:

  • {:authenticated data} — success, assoc identity into request (falsy data is treated as a skip)
  • {:error error} — auth attempted but failed
  • nil — not applicable, try next strategy Optional :unauthorized (fn [req error]) handles rejection. Only called when the strategy returned an error.

Options:

  • :allow-anonymous? (default false) — when true and no strategy is applicable (all returned nil), the request passes through to the handler without identity. A strategy error still produces a 401.
Ring middleware that tries each strategy in order.
Each strategy's `:authenticate` fn returns:
- `{:authenticated data}` — success, assoc identity into request (falsy `data` is treated as a skip)
- `{:error error}`        — auth attempted but failed
- `nil`                   — not applicable, try next strategy
Optional `:unauthorized` `(fn [req error])` handles rejection.
Only called when the strategy returned an error.

Options:
- `:allow-anonymous?` (default `false`) — when true and no strategy is
  applicable (all returned nil), the request passes through to the handler
  without identity. A strategy error still produces a 401.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close