(create-authcode-store type config)
Initializes empty authcode store of given type - :in-memory, :sql or :redis one.
Redis-based authcode store expects redis connection spec passed in a config
parameter
whereas SQL-based one requires an initialized database connection.
Initializes empty authcode store of given type - :in-memory, :sql or :redis one. Redis-based authcode store expects redis connection spec passed in a `config` parameter whereas SQL-based one requires an initialized database connection.
(create-client grants
redirects
&
{:keys [info scopes enabled? approved? id secret]})
Creates new OAuth client.
grants
: an optional vector of allowed grants: authorization_code, token, password, client_credentials.
at least one grant needs to be provided.
redirects
: a validated vector of approved redirect-uris.
redirect-uri passed along with token request should match one of these entries.
info
: optional non-validated info string (typically client's app name or URL to client's homepage)
scopes
: optional vector of OAuth scopes that client may request an access to
enabled?
: optional (false by default). should client be automatically enabled?
approved?
: optional (false by default). should client be auto-approved?
id
: optional client ID (must be unique), auto-generated if none provided
secret
: optional client secret (must be hard to guess), auto-generated if none provided
Example:
(c/create-client ["authorization_code" "password"]
["http://defunkt.pl/callback"]
:info "http://defunkt.pl"
:scopes ["photo:read" "photo:list"]
:enabled? true
:approved? true)
Creates new OAuth client. `grants` : an optional vector of allowed grants: authorization_code, token, password, client_credentials. at least one grant needs to be provided. `redirects` : a validated vector of approved redirect-uris. redirect-uri passed along with token request should match one of these entries. `info` : optional non-validated info string (typically client's app name or URL to client's homepage) `scopes` : optional vector of OAuth scopes that client may request an access to `enabled?` : optional (false by default). should client be automatically enabled? `approved?` : optional (false by default). should client be auto-approved? `id` : optional client ID (must be unique), auto-generated if none provided `secret` : optional client secret (must be hard to guess), auto-generated if none provided Example: (c/create-client ["authorization_code" "password"] ["http://defunkt.pl/callback"] :info "http://defunkt.pl" :scopes ["photo:read" "photo:list"] :enabled? true :approved? true)
(create-client-store type config)
Initializes empty client store of given type - :in-memory, :sql or :redis one.
Redis-based client store expects redis connection spec passed in a config
parameter
whereas SQL-based one requires an initialized database connection.
Initializes empty client store of given type - :in-memory, :sql or :redis one. Redis-based client store expects redis connection spec passed in a `config` parameter whereas SQL-based one requires an initialized database connection.
(create-session-store type config)
Initializes empty session store of given type - :in-memory, :sql or :redis one.
Redis-based session store expects redis connection spec passed in a config
parameter
whereas SQL-based one requires an initialized database connection.
Initializes empty session store of given type - :in-memory, :sql or :redis one. Redis-based session store expects redis connection spec passed in a `config` parameter whereas SQL-based one requires an initialized database connection.
(create-token-store type config)
Initializes empty token store of given type - :in-memory, :sql or :redis one.
Redis-based token store expects redis connection spec passed in a config
parameter
whereas SQL-based one requires an initialized database connection.
Initializes empty token store of given type - :in-memory, :sql or :redis one. Redis-based token store expects redis connection spec passed in a `config` parameter whereas SQL-based one requires an initialized database connection.
(create-user login password & {:keys [name email roles enabled?]})
Creates new user with login
and password
and optional details
like descriptive name, email and roles.
Example:
(c/create-user "foobar" "secret"
:name "Foo Bar"
:email "foo@bar.bazz"
:roles #{"user/admin"}
:enabled? true)
Creates new user with `login` and `password` and optional details like descriptive name, email and roles. Example: (c/create-user "foobar" "secret" :name "Foo Bar" :email "foo@bar.bazz" :roles #{"user/admin"} :enabled? true)
(create-user-store type config)
Initializes empty user store of given type - :in-memory, :sql or :redis one.
Redis-based user store expects redis connection spec passed in a config
parameter
whereas SQL-based one requires an initialized database connection.
Initializes empty user store of given type - :in-memory, :sql or :redis one. Redis-based user store expects redis connection spec passed in a `config` parameter whereas SQL-based one requires an initialized database connection.
(delete-client client-id)
Removes client from store along with all its access- and refresh-tokens.
Removes client from store along with all its access- and refresh-tokens.
(delete-user login)
Removes user from store.
Removes user from store.
(disable-client client-id)
Disables client.
Revokes all client's tokens and prevents from gaining new ones. When disabled, client is no longer able to request permissions to any resource.
Disables client. Revokes all client's tokens and prevents from gaining new ones. When disabled, client is no longer able to request permissions to any resource.
(disable-user login)
Disables user.
Disabled user is no longer able to authenticate and all access tokens created based on his grants become immediately invalid.
Disables user. Disabled user is no longer able to authenticate and all access tokens created based on his grants become immediately invalid.
(enable-client client-id)
Enables client.
When enabled, client is able to request access to user's resource and (when accepted) get corresponding access-token in response.
Enables client. When enabled, client is able to request access to user's resource and (when accepted) get corresponding access-token in response.
(enable-user login)
Enables user.
Enabled user is able to authenticate and approve or deny access to resources requested by OAuth clients.
Enables user. Enabled user is able to authenticate and approve or deny access to resources requested by OAuth clients.
(find-access-token secret)
Returns access-token bound to given secret.
Returns access-token bound to given secret.
(find-client client-id)
Looks up for client with given identifier.
Looks up for client with given identifier.
(find-refresh-tokens client-id)
(find-refresh-tokens client-id login)
Returns list of refresh tokens generated for client-id
and
optionally - for a login
user.
Returns list of refresh tokens generated for `client-id` and optionally - for a `login` user.
(find-user login)
Looks up for a user with given login.
Looks up for a user with given login.
(init-clients clients)
Initializes client-store with predefined collection of clients.
Initializes client-store with predefined collection of clients.
(init-users users)
Initializes users-store with predefined collection of users.
Initializes users-store with predefined collection of users.
(regenerate-tokens client-id login scope)
Generates both access- and refresh-tokens for client-id
enabling
access to login
's resources defined by scope
. Revokes and overrides
existing tokens issued for client for login
user if any exist.
Generates both access- and refresh-tokens for `client-id` enabling access to `login`'s resources defined by `scope`. Revokes and overrides existing tokens issued for client for `login` user if any exist.
(revoke-access-token secret)
Revokes single access-token.
Revokes single access-token.
(revoke-client-tokens client-id)
(revoke-client-tokens client-id login)
Revokes all access- and refresh-tokens bound with client-id
,
optionally narrowing revoked tokens to given login
only.
Revokes all access- and refresh-tokens bound with `client-id`, optionally narrowing revoked tokens to given `login` only.
(set-authcode-valid-for! valid-for)
Sets up an auth-code time-to-live (TTL) which essentially says how long OAuth2 authcodes are valid. Returns newly set value.
Sets up an auth-code time-to-live (TTL) which essentially says how long OAuth2 authcodes are valid. Returns newly set value.
(set-authentication-url! auth-url)
Sets up an OAuth2 authentication URL. Returns newly set value.
Sets up an OAuth2 authentication URL. Returns newly set value.
(set-landing-url! landing-url)
Sets up a landing URL that browser should redirect to after successful authentication. Returns newly set value.
Sets up a landing URL that browser should redirect to after successful authentication. Returns newly set value.
(set-realm! realm)
Sets up a global OAuth2 realm. Returns newly set value.
Sets up a global OAuth2 realm. Returns newly set value.
(set-session-valid-for! valid-for)
Sets up a session time-to-live (TTL) which essentially says how long OAuth2 sessions are valid. Returns newly set value.
Sets up a session time-to-live (TTL) which essentially says how long OAuth2 sessions are valid. Returns newly set value.
(set-token-valid-for! valid-for)
Sets up a token time-to-live (TTL) which essentially says how long OAuth2 tokens are valid. Returns newly set value.
Sets up a token time-to-live (TTL) which essentially says how long OAuth2 tokens are valid. Returns newly set value.
(set-unauthorized-url! auth-url)
Sets up a location that browser should redirect to in case of HTTP 401 Unauthorized. Returns newly set value.
Sets up a location that browser should redirect to in case of HTTP 401 Unauthorized. Returns newly set value.
(update-settings settings)
Bulk update of OAuth2 global settings with provided settings
map.
Bulk update of OAuth2 global settings with provided `settings` map.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close