(checks token client secret)Returns a map describing the validity of token: :not-expired?,
:valid-nbf?, :valid-audience?, :valid-dest?, and :valid-signature?.
Malformed tokens return {:validity false :error ...}.
Returns a map describing the validity of `token`: :not-expired?,
:valid-nbf?, :valid-audience?, :valid-dest?, and :valid-signature?.
Malformed tokens return {:validity false :error ...}.(claims token)(claims token k)Returns the decoded claims map of token, or the value at key k.
Returns the decoded claims map of `token`, or the value at key `k`.
(compute-signature header claims secret)Returns the unpadded base64url HMAC-SHA256 of header.claims under
secret.
Returns the unpadded base64url HMAC-SHA256 of `header.claims` under `secret`.
(debug-token token client secret)Returns the result of checks for token, including failure details.
Returns the result of `checks` for `token`, including failure details.
(decode-jwt token)Decodes a token into [header-json claims-json signature-bytes].
Header and claims are UTF-8 text; the signature is returned as raw bytes, since it is binary and must not be UTF-8-decoded.
Decodes a token into [header-json claims-json signature-bytes]. Header and claims are UTF-8 text; the signature is returned as raw bytes, since it is binary and must not be UTF-8-decoded.
(headers token)Returns the decoded header map of token.
Returns the decoded header map of `token`.
(signature token)Returns the raw signature bytes.
Returns the raw signature bytes.
(valid-audience? aud client)Returns true when client matches aud, which may be a single value
or a collection of acceptable values.
Returns true when `client` matches `aud`, which may be a single value or a collection of acceptable values.
(valid-nbf? nbf & {:keys [clock-tolerance] :or {clock-tolerance 20}})Returns true when nbf is not later than now plus clock-tolerance
seconds (default 20).
Returns true when `nbf` is not later than now plus `clock-tolerance` seconds (default 20).
(valid-signature? token secret)Returns true when the signature in token matches the HMAC-SHA256 of its
header and claims under secret.
Returns true when the signature in `token` matches the HMAC-SHA256 of its header and claims under `secret`.
(valid-token? token client secret)Returns true when every check for token passes.
Returns true when every check for `token` passes.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |