pub enum Oauth2Type {
    AuthorizationCode(String),
    PKCE(PkceCode),
    ImplicitGrant(String),
}
Expand description

Which type of OAuth2 flow to use.

Variants§

§

AuthorizationCode(String)

The Authorization Code flow yields a temporary authorization code which must be turned into an OAuth2 token by making another call. The authorization page can do a web redirect back to your app with the code (if it is a server-side app), or can be used without a redirect URI, in which case the authorization page displays the authorization code to the user and they must then input the code manually into the program.

§

PKCE(PkceCode)

The PKCE flow is an extension of the Authorization Code flow which uses dynamically generated codes instead of an app secret to perform the OAuth exchange. This both avoids having a hardcoded secret in the app (useful for client-side / mobile apps) and also ensures that the authorization code can only be used by the client.

§

ImplicitGrant(String)

In Implicit Grant flow, the authorization page directly includes an OAuth2 token when it redirects the user’s web browser back to your program, and no separate call to generate a token is needed. This can ONLY be used with a redirect URI.

This flow is considered “legacy” and is not as secure as the other flows.

Trait Implementations§

source§

impl Clone for Oauth2Type

source§

fn clone(&self) -> Oauth2Type

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Oauth2Type

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.