pub enum Oauth2Type {
AuthorizationCode {
client_secret: String,
},
PKCE(PkceCode),
ImplicitGrant,
}
Expand description
Which type of OAuth2 flow to use.
Variants§
AuthorizationCode
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
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
impl Clone for Oauth2Type
Source§fn clone(&self) -> Oauth2Type
fn clone(&self) -> Oauth2Type
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more