Module oauth2

Source
Expand description

Helpers for requesting OAuth2 tokens.

OAuth2 has a few possible ways to authenticate, and the right choice depends on how your app operates and is deployed.

For an overview, see the Dropbox OAuth Guide.

For quick recommendations based on the type of app you have, see the OAuth types summary.

Structs§

Authorization
Provides for continuing authorization of the app.
AuthorizeUrlBuilder
Builds a URL that can be given to the user to visit to have Dropbox authorize your app.
PkceCode
A proof key for OAuth2 PKCE (“Proof Key for Code Exchange”) flow.
TokenCache
TokenCache provides the current OAuth2 token and a means to refresh it in a thread-safe way.

Enums§

Oauth2Type
Which type of OAuth2 flow to use.
TokenType
What type of access token is requested? If unsure, ShortLivedAndRefresh is probably what you want.

Functions§

get_auth_from_env_or_prompt
Get an Authorization instance from environment variables DBX_CLIENT_ID and DBX_OAUTH (containing a refresh token) or DBX_OAUTH_TOKEN (containing a legacy long-lived token).