(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)
(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"})
(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-client client-id)
Looks up for client with given identifier.
Looks up for client with given identifier.
(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.
(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.
(find-user login)
Looks up for a user with given login.
Looks up for a user with given login.
(revoke-access-token secret)
Revokes single access-token.
Revokes single access-token.
(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).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close