(make-client {:as config :keys [keywordize-keys] {:keys [request]} :fns})
Given a config map
{#{:client_id :client_secret} <string> :provider #{:google :amazon :github :twitter ...} #{:auth_uri :token_uri} <string> :fns {#{:request :query-string :encode :decode} <fn-or-var>} :keywordize-keys <boolean>}
Returns a wrapped request function.
If provider
is known, then auth_uri and token_uri endpoints will be added to the config,
otherwise expects auth_uri
and token_uri
.
provider
is required to namespace tokens, but is not restricted to known providers.
Dependencies are passed as functions in fns
.
Given a config map {#{:client_id :client_secret} <string> :provider #{:google :amazon :github :twitter ...} #{:auth_uri :token_uri} <string> :fns {#{:request :query-string :encode :decode} <fn-or-var>} :keywordize-keys <boolean>} Returns a wrapped request function. If `provider` is known, then auth_uri and token_uri endpoints will be added to the config, otherwise expects `auth_uri` and `token_uri`. `provider` is required to namespace tokens, but is not restricted to known providers. Dependencies are passed as functions in `fns`.
(oauth2 request args config)
Performs a http-request that includes oauth2 credentials. Will obtain fresh credentials prior to the request if necessary. See https://developers.google.com/identity/protocols/oauth2 for more information.
Performs a http-request that includes oauth2 credentials. Will obtain fresh credentials prior to the request if necessary. See https://developers.google.com/identity/protocols/oauth2 for more information.
(oauth2-async request args config respond raise)
Only the http request is asynchronous; reading, updating, or writing credentials is done synchronously. Asynchronously obtaining credentials is challenging because it may rely on waiting for a redirect back. This compromise allows for convenient usage, but means that calls may block while authorizing before the http request is made.
Only the http request is asynchronous; reading, updating, or writing credentials is done synchronously. Asynchronously obtaining credentials is challenging because it may rely on waiting for a redirect back. This compromise allows for convenient usage, but means that calls may block while authorizing before the http request is made.
(with-endpoints {:as config :keys [provider]})
The only configuration required is to know the provider (for endpoints), the client-id and the client-secret. This helper adds the endpoints for a given provider.
The only configuration required is to know the provider (for endpoints), the client-id and the client-secret. This helper adds the endpoints for a given provider.
(wrap-oauth2 request config)
Wraps an http-request function that uses keys user and scopes from args to authorize according to config.
Wraps an http-request function that uses keys user and scopes from args to authorize according to config.
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 |