Liking cljdoc? Tell your friends :D

kryptos.jwt


checksclj

(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 ...}.
sourceraw docstring

claimsclj

(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`.
sourceraw docstring

compute-signatureclj

(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`.
sourceraw docstring

debug-tokenclj

(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.
sourceraw docstring

decode-jwtclj

(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.
sourceraw docstring

headersclj

(headers token)

Returns the decoded header map of token.

Returns the decoded header map of `token`.
sourceraw docstring

signatureclj

(signature token)

Returns the raw signature bytes.

Returns the raw signature bytes.
sourceraw docstring

valid-audience?clj

(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.
sourceraw docstring

valid-nbf?clj

(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).
sourceraw docstring

valid-signature?clj

(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`.
sourceraw docstring

valid-token?clj

(valid-token? token client secret)

Returns true when every check for token passes.

Returns true when every check for `token` passes.
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