Liking cljdoc? Tell your friends :D

cerber.oauth2.core


create-authcode-storeclj

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

create-clientclj

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

create-client-storeclj

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

create-session-storeclj

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

create-token-storeclj

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

create-userclj

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

create-user-storeclj

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

delete-clientclj

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

delete-userclj

(delete-user login)

Removes user from store.

Removes user from store.
sourceraw docstring

disable-clientclj

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

disable-userclj

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

enable-clientclj

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

enable-userclj

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

find-access-tokenclj

(find-access-token secret)

Returns access-token bound to given secret.

Returns access-token bound to given secret.
sourceraw docstring

find-clientclj

(find-client client-id)

Looks up for client with given identifier.

Looks up for client with given identifier.
sourceraw docstring

find-refresh-tokensclj

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

find-userclj

(find-user login)

Looks up for a user with given login.

Looks up for a user with given login.
sourceraw docstring

init-clientsclj

(init-clients clients)

Initializes client-store with predefined collection of clients.

Initializes client-store with predefined collection of clients.
sourceraw docstring

init-usersclj

(init-users users)

Initializes users-store with predefined collection of users.

Initializes users-store with predefined collection of users.
sourceraw docstring

regenerate-tokensclj

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

revoke-access-tokenclj

(revoke-access-token secret)

Revokes single access-token.

Revokes single access-token.
sourceraw docstring

revoke-client-tokensclj

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

set-authcode-valid-for!clj

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

set-authentication-url!clj

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

set-landing-url!clj

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

set-realm!clj

(set-realm! realm)

Sets up a global OAuth2 realm. Returns newly set value.

Sets up a global OAuth2 realm. Returns newly set value.
sourceraw docstring

set-session-valid-for!clj

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

set-token-valid-for!clj

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

set-unauthorized-url!clj

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

update-settingsclj

(update-settings settings)

Bulk update of OAuth2 global settings with provided settings map.

Bulk update of OAuth2 global settings with provided `settings` map.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close