Token endpoint implementation for OAuth2/OIDC.
Token endpoint implementation for OAuth2/OIDC.
(handle-authorization-code-grant {:keys [code redirect_uri code_verifier]}
client
provider-config
code-store
token-store
claims-provider)Handles authorization_code grant type.
Args: params: Token request parameters client: Authenticated client configuration provider-config: Provider configuration map code-store: AuthorizationCodeStore implementation token-store: TokenStore implementation claims-provider: ClaimsProvider implementation
Returns: Token response map
Handles authorization_code grant type. Args: params: Token request parameters client: Authenticated client configuration provider-config: Provider configuration map code-store: AuthorizationCodeStore implementation token-store: TokenStore implementation claims-provider: ClaimsProvider implementation Returns: Token response map
(handle-client-credentials-grant {:keys [scope resource]}
client
provider-config
token-store)Handles client_credentials grant type.
Args: params: Token request parameters client: Authenticated client configuration provider-config: Provider configuration map token-store: TokenStore implementation
Returns: Token response map
Handles client_credentials grant type. Args: params: Token request parameters client: Authenticated client configuration provider-config: Provider configuration map token-store: TokenStore implementation Returns: Token response map
(handle-refresh-token-grant {:keys [refresh_token scope resource]}
client
provider-config
token-store)Handles refresh_token grant type.
Args: params: Token request parameters client: Authenticated client configuration provider-config: Provider configuration map token-store: TokenStore implementation
Returns: Token response map
Handles refresh_token grant type. Args: params: Token request parameters client: Authenticated client configuration provider-config: Provider configuration map token-store: TokenStore implementation Returns: Token response map
(handle-token-request params
authorization-header
provider-config
client-store
code-store
token-store
claims-provider)Handles token endpoint requests.
Takes the parsed params map (as produced by Ring's wrap-params and
wrap-keyword-params middleware), the authorization-header for client
authentication, and the usual provider stores. Multi-value resource
parameters (RFC 8707) should already be present in params as a string or
vector — Ring's wrap-params handles this automatically for repeated form
fields. Validates the request, authenticates the client, and dispatches to
the appropriate grant handler. Returns a token response map. Throws ex-info
on validation or processing errors.
Handles token endpoint requests. Takes the parsed `params` map (as produced by Ring's `wrap-params` and `wrap-keyword-params` middleware), the `authorization-header` for client authentication, and the usual provider stores. Multi-value `resource` parameters (RFC 8707) should already be present in `params` as a string or vector — Ring's `wrap-params` handles this automatically for repeated form fields. Validates the request, authenticates the client, and dispatches to the appropriate grant handler. Returns a token response map. Throws `ex-info` on validation or processing errors.
(token-error-response error
error-description
&
{:keys [status] :or {status 400}})Creates an OAuth2 error response.
Args: error: Error code (e.g., "invalid_request", "invalid_client") error-description: Human-readable error description status: HTTP status code (default 400)
Returns: Map with :status, :headers, and :body
Creates an OAuth2 error response. Args: error: Error code (e.g., "invalid_request", "invalid_client") error-description: Human-readable error description status: HTTP status code (default 400) Returns: Map with :status, :headers, and :body
Malli schema for token request parameters.
Malli schema for token request parameters.
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 |