Struct dropbox_sdk::oauth2::Authorization [−][src]
pub struct Authorization { /* fields omitted */ }
Expand description
Provides for continuing authorization of the app.
Implementations
pub fn from_auth_code(
client_id: String,
flow_type: Oauth2Type,
auth_code: String,
redirect_uri: Option<String>
) -> Self
pub fn from_auth_code(
client_id: String,
flow_type: Oauth2Type,
auth_code: String,
redirect_uri: Option<String>
) -> Self
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
Auto Trait Implementations
impl RefUnwindSafe for Authorization
impl Send for Authorization
impl Sync for Authorization
impl Unpin for Authorization
impl UnwindSafe for Authorization
Blanket Implementations
Mutably borrows from an owned value. Read more