pub trait SimpleOAuthProvider:
Debug
+ Send
+ Sync {
// Required methods
fn authorize_url(&self) -> &str;
fn token_url(&self) -> &str;
fn user_info_url(&self) -> &str;
fn default_scopes(&self) -> &'static [&'static str];
fn extract_user_info(&self, val: Value) -> Result<UserInfo, Error>;
// Provided method
fn additional_headers(&self) -> Vec<(String, String)> { ... }
}Expand description
Trait for all OAuth providers
Required Methods§
The authorization endpoint of the provider
Sourcefn user_info_url(&self) -> &str
fn user_info_url(&self) -> &str
The URL to fetch the user info from the provider
Sourcefn default_scopes(&self) -> &'static [&'static str]
fn default_scopes(&self) -> &'static [&'static str]
Minimum scopes needed to get basic profile info (id, name, username). Email is not included
by default - the user can specify that by passing
in custom scopes when calling client.authorize_url()
Provided Methods§
Sourcefn additional_headers(&self) -> Vec<(String, String)>
fn additional_headers(&self) -> Vec<(String, String)>
Additional headers to send when making requests to the provider
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".