Liking cljdoc? Tell your friends :D

co.gaiwan.oak.domain.jwt

Utility functions for creating/handling JWTs and JWT claims.

Both access tokens and ID tokens.

Utility functions for creating/handling JWTs and JWT claims.

Both access tokens and ID tokens.
raw docstring

access-token-claimsclj

(access-token-claims {:keys [issuer identity-id client-id now scope]
                      :or {now (System/currentTimeMillis)}})

Generate JWT claims for an access token

Generate JWT claims for an access token
raw docstring

at-expclj

(at-exp now)

at-hashclj

(at-hash access-token hash-alg)

Compute the at-hash claim, which is base64url(leftmostHalf(hash(access-token)))

Compute the `at-hash` claim, which is
base64url(leftmostHalf(hash(access-token)))
raw docstring

expired?clj

(expired? claims)

iatclj

(iat now)

id-expclj

(id-exp now)

id-token-claimsclj

(id-token-claims db
                 {:keys [issuer identity-id client-id now auth-time hash-alg
                         access-token scope]})

Generate JWT claims for an id token

Generate JWT claims for an id token
raw docstring

parse-verifyclj

(parse-verify db token)

Lookup the JWK based on the key id (kid) in the token header, then check the signature, and return the claims map

Lookup the JWK based on the key id (kid) in the token header, then check the
signature, and return the claims map
raw docstring

update-at-claimsclj

(update-at-claims claims {:keys [now]})

update-id-claimsclj

(update-id-claims claims {:keys [now hash-alg access-token] :as opts})

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