Struct dropbox_sdk::oauth2::Authorization[][src]

pub struct Authorization { /* fields omitted */ }
Expand description

Provides for continuing authorization of the app.

Implementations

Create a new instance using the authorization code provided upon redirect back to your app (or via manual user entry if not using a redirect URI) after the user logs in.

Requires the client ID; the type of OAuth2 flow being used (including the client secret or the PKCE challenge); the authorization code; and the redirect URI used for the original authorization request, if any.

Save the authorization state to a string which can be reloaded later.

Returns None if the state cannot be saved (e.g. authorization has not completed getting a token yet).

Reload a saved authorization state produced by save.

Returns None if the string could not be recognized. In this case, you should start the authorization procedure from scratch.

Note that a loaded authorization state is not necessarily still valid and may produce Authentication errors. In such a case you should also start the authorization procedure from scratch.

Recreate the authorization from an authorization code and refresh token.

Recreate the authorization from a long-lived access token. This token cannot be refreshed; any call to obtain_access_token will simply return the given token.

Obtain an access token. Use this to complete the authorization process, or to obtain an updated token when a short-lived access token has expired.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.