Liking cljdoc? Tell your friends :D

chromex.app.identity

clj

Use the chrome.identity API to get OAuth2 access tokens.

Use the chrome.identity API to get OAuth2 access tokens.

* available since Chrome 36
* https://developer.chrome.com/apps/identity
raw docstring

api-tableclj

source

clear-all-cached-auth-tokensclj/smacro

(clear-all-cached-auth-tokens)

Resets the state of the Identity API: - Removes all OAuth2 access tokens from the token cache - Removes user's account preferences - De-authorizes the user from all auth flows

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/identity#method-clearAllCachedAuthTokens.

Resets the state of the Identity API: - Removes all OAuth2 access tokens from the token cache - Removes user's account
preferences - De-authorizes the user from all auth flows

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/identity#method-clearAllCachedAuthTokens.
sourceraw docstring

clear-all-cached-auth-tokens*cljs

(clear-all-cached-auth-tokens* config)
source

gen-callclj

source

gen-wrapclj/smacro

(gen-wrap kind item-id config & args)
source

get-accountsclj/smacro

(get-accounts)

Retrieves a list of AccountInfo objects describing the accounts present on the profile.getAccounts is only supported on dev channel.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [accounts] where:

|accounts| - https://developer.chrome.com/apps/identity#property-callback-accounts.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/identity#method-getAccounts.

Retrieves a list of AccountInfo objects describing the accounts present on the profile.getAccounts is only supported on dev
channel.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [accounts] where:

  |accounts| - https://developer.chrome.com/apps/identity#property-callback-accounts.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/identity#method-getAccounts.
sourceraw docstring

get-accounts*cljs

(get-accounts* config)
source

get-auth-tokenclj/smacro

(get-auth-token)
(get-auth-token details)

Gets an OAuth2 access token using the client ID and scopes specified in the oauth2 section of manifest.json.The Identity API caches access tokens in memory, so it's ok to call getAuthToken non-interactively any time a token is required. The token cache automatically handles expiration.For a good user experience it is important interactive token requests are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests, or Chrome sign in screens if they are not signed in, with with no context. In particular, do not use getAuthToken interactively when your app is first launched.

|details| - Token options.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [token granted-scopes] where:

|token| - https://developer.chrome.com/apps/identity#property-callback-token. |granted-scopes| - https://developer.chrome.com/apps/identity#property-callback-grantedScopes.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/identity#method-getAuthToken.

Gets an OAuth2 access token using the client ID and scopes specified in the oauth2 section of manifest.json.The Identity
API caches access tokens in memory, so it's ok to call getAuthToken non-interactively any time a token is required. The
token cache automatically handles expiration.For a good user experience it is important interactive token requests are
initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get
authorization requests, or Chrome sign in screens if they are not signed in, with with no context. In particular, do not
use getAuthToken interactively when your app is first launched.

  |details| - Token options.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [token granted-scopes] where:

  |token| - https://developer.chrome.com/apps/identity#property-callback-token.
  |granted-scopes| - https://developer.chrome.com/apps/identity#property-callback-grantedScopes.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/identity#method-getAuthToken.
sourceraw docstring

get-auth-token*cljs

(get-auth-token* config details)
source

get-profile-user-infoclj/smacro

(get-profile-user-info)
(get-profile-user-info details)

Retrieves email address and obfuscated gaia id of the user signed into a profile.Requires the identity.email manifest permission. Otherwise, returns an empty result.This API is different from identity.getAccounts in two ways. The information returned is available offline, and it only applies to the primary account for the profile.

|details| - Profile options.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [user-info] where:

|user-info| - https://developer.chrome.com/apps/identity#property-callback-userInfo.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/identity#method-getProfileUserInfo.

Retrieves email address and obfuscated gaia id of the user signed into a profile.Requires the identity.email manifest
permission. Otherwise, returns an empty result.This API is different from identity.getAccounts in two ways. The information
returned is available offline, and it only applies to the primary account for the profile.

  |details| - Profile options.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [user-info] where:

  |user-info| - https://developer.chrome.com/apps/identity#property-callback-userInfo.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/identity#method-getProfileUserInfo.
sourceraw docstring

get-profile-user-info*cljs

(get-profile-user-info* config details)
source

get-redirect-urlclj/smacro

(get-redirect-url)
(get-redirect-url path)

Generates a redirect URL to be used in |launchWebAuthFlow|.The generated URLs match the pattern https://<app-id>.chromiumapp.org/*.

|path| - The path appended to the end of the generated URL.

https://developer.chrome.com/apps/identity#method-getRedirectURL.

Generates a redirect URL to be used in |launchWebAuthFlow|.The generated URLs match the pattern
https://<app-id>.chromiumapp.org/*.

  |path| - The path appended to the end of the generated URL.

https://developer.chrome.com/apps/identity#method-getRedirectURL.
sourceraw docstring

get-redirect-url*cljs

(get-redirect-url* config path)
source

launch-web-auth-flowclj/smacro

(launch-web-auth-flow details)

Starts an auth flow at the specified URL.This method enables auth flows with non-Google identity providers by launching a web view and navigating it to the first URL in the provider's auth flow. When the provider redirects to a URL matching the pattern https://<app-id>.chromiumapp.org/*, the window will close, and the final redirect URL will be passed to the callback function.For a good user experience it is important interactive auth flows are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests with no context. In particular, do not launch an interactive auth flow when your app is first launched.

|details| - WebAuth flow options.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [response-url] where:

|response-url| - https://developer.chrome.com/apps/identity#property-callback-responseUrl.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/identity#method-launchWebAuthFlow.

Starts an auth flow at the specified URL.This method enables auth flows with non-Google identity providers by launching a
web view and navigating it to the first URL in the provider's auth flow. When the provider redirects to a URL matching the
pattern https://<app-id>.chromiumapp.org/*, the window will close, and the final redirect URL will be passed to the
callback function.For a good user experience it is important interactive auth flows are initiated by UI in your app
explaining what the authorization is for. Failing to do this will cause your users to get authorization requests with no
context. In particular, do not launch an interactive auth flow when your app is first launched.

  |details| - WebAuth flow options.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [response-url] where:

  |response-url| - https://developer.chrome.com/apps/identity#property-callback-responseUrl.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/identity#method-launchWebAuthFlow.
sourceraw docstring

launch-web-auth-flow*cljs

(launch-web-auth-flow* config details)
source

on-sign-in-changed*cljs

(on-sign-in-changed* config channel & args)
source

remove-cached-auth-tokenclj/smacro

(remove-cached-auth-token details)

Removes an OAuth2 access token from the Identity API's token cache.If an access token is discovered to be invalid, it should be passed to removeCachedAuthToken to remove it from the cache. The app may then retrieve a fresh token with getAuthToken.

|details| - Token information.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/identity#method-removeCachedAuthToken.

Removes an OAuth2 access token from the Identity API's token cache.If an access token is discovered to be invalid, it
should be passed to removeCachedAuthToken to remove it from the cache. The app may then retrieve a fresh token with
getAuthToken.

  |details| - Token information.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/identity#method-removeCachedAuthToken.
sourceraw docstring

remove-cached-auth-token*cljs

(remove-cached-auth-token* config details)
source

tap-all-eventsclj/smacro

(tap-all-events chan)

Taps all valid non-deprecated events in chromex.app.identity namespace.

Taps all valid non-deprecated events in chromex.app.identity namespace.
sourceraw docstring

tap-on-sign-in-changed-eventsclj/smacro

(tap-on-sign-in-changed-events channel & args)

Fired when signin state changes for an account on the user's profile.

Events will be put on the |channel| with signature [::on-sign-in-changed [account signed-in]] where:

|account| - https://developer.chrome.com/apps/identity#property-onSignInChanged-account. |signed-in| - https://developer.chrome.com/apps/identity#property-onSignInChanged-signedIn.

Note: |args| will be passed as additional parameters into Chrome event's .addListener call.

https://developer.chrome.com/apps/identity#event-onSignInChanged.

Fired when signin state changes for an account on the user's profile.

Events will be put on the |channel| with signature [::on-sign-in-changed [account signed-in]] where:

  |account| - https://developer.chrome.com/apps/identity#property-onSignInChanged-account.
  |signed-in| - https://developer.chrome.com/apps/identity#property-onSignInChanged-signedIn.

Note: |args| will be passed as additional parameters into Chrome event's .addListener call.

https://developer.chrome.com/apps/identity#event-onSignInChanged.
sourceraw docstring

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

× close