Liking cljdoc? Tell your friends :D

cerber.oauth2.core


create-clientclj

(create-client info redirects & [grants scopes approved?])

Creates new OAuth client.

info is a non-validated info string (typically client's app name or URL to client's homepage)

redirects is a validated vector of approved redirect-uris; redirect-uri provided with token request should match one of these entries

grants is an optional vector of allowed grants: authorization_code, token, password or client_credentials; all grants allowed if set to nil

scopes is an optional vector of OAuth scopes that client may request an access to

approved? decides whether client should be auto-approved or not. Set to false by default.

Example:

(c/create-client "http://defunkt.pl"
                 ["http://defunkt.pl/callback"]
                 ["authorization_code" "password"]
                 ["photo:read" "photo:list"]
                 true)
Creates new OAuth client.

`info` is a non-validated info string (typically client's app name or URL to client's homepage)

`redirects` is a validated vector of approved redirect-uris; redirect-uri provided with token request should match one of these entries

`grants` is an optional vector of allowed grants: authorization_code, token, password or client_credentials; all grants allowed if set to nil

`scopes` is an optional vector of OAuth scopes that client may request an access to

`approved?` decides whether client should be auto-approved or not. Set to false by default.

Example:

    (c/create-client "http://defunkt.pl"
                     ["http://defunkt.pl/callback"]
                     ["authorization_code" "password"]
                     ["photo:read" "photo:list"]
                     true)
sourceraw docstring

create-userclj

(create-user login name email password roles permissions enabled?)

Creates new user with given login, descriptive name, user's email, password (stored as hash), roles and permissions.

roles set of user's roles

permissions set of user's permissions

enabled? decides whether user should be enabled or not. Set to true by default.

Example:

(c/create-user "foobar"
               "Foo Bar"
               "foo@bar.bazz"
               "secret"
               #{"user/admin"}
               #{"photos:read"})
Creates new user with given login, descriptive name, user's email, password (stored as hash), roles and permissions.

`roles` set of user's roles

`permissions` set of user's permissions

`enabled?` decides whether user should be enabled or not. Set to true by default.

Example:

    (c/create-user "foobar"
                   "Foo Bar"
                   "foo@bar.bazz"
                   "secret"
                   #{"user/admin"}
                   #{"photos:read"})
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-clientclj

(find-client client-id)

Looks up for client with given identifier.

Looks up for client with given identifier.
sourceraw docstring

find-tokens-by-clientclj

(find-tokens-by-client client-id token-type)

Returns list of "access" or "refresh" tokens generated for given client.

Returns list of "access" or "refresh" tokens generated for given client.
sourceraw docstring

find-tokens-by-userclj

(find-tokens-by-user login token-type)

Returns list of "access" or "refresh" tokens generated for clients operating on behalf of given user.

Returns list of "access" or "refresh" tokens generated for clients operating on behalf of given 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

revoke-access-tokenclj

(revoke-access-token secret)

Revokes single access-token.

Revokes single access-token.
sourceraw docstring

revoke-tokensclj

(revoke-tokens client-id)
(revoke-tokens client-id login)

Revokes all access- and refresh-tokens bound with given client (and optional user).

Revokes all access- and refresh-tokens bound with given client (and optional user).
sourceraw docstring

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

× close