pub struct OAuthProvider {Show 14 fields
pub client_id: String,
pub client_secret: String,
pub auth_url: String,
pub token_url: String,
pub user_info_url: Option<String>,
pub scopes: Vec<String>,
pub authorization_params: Vec<(String, String)>,
pub map_user_info: Option<fn(Value) -> Result<OAuthUserInfo, String>>,
pub get_user_info: Option<Arc<dyn OAuthUserInfoHandler>>,
pub refresh_access_token: Option<Arc<dyn OAuthRefreshTokenHandler>>,
pub verify_id_token: Option<Arc<dyn OAuthIdTokenVerifier>>,
pub disable_implicit_sign_up: bool,
pub disable_sign_up: bool,
pub override_user_info_on_sign_in: bool,
}Expand description
Configuration for a single OAuth provider.
Fields§
§client_id: String§client_secret: String§auth_url: String§token_url: String§user_info_url: Option<String>§scopes: Vec<String>§map_user_info: Option<fn(Value) -> Result<OAuthUserInfo, String>>§get_user_info: Option<Arc<dyn OAuthUserInfoHandler>>§refresh_access_token: Option<Arc<dyn OAuthRefreshTokenHandler>>§verify_id_token: Option<Arc<dyn OAuthIdTokenVerifier>>§disable_implicit_sign_up: bool§disable_sign_up: bool§override_user_info_on_sign_in: boolImplementations§
Source§impl OAuthProvider
impl OAuthProvider
pub fn google(client_id: &str, client_secret: &str) -> Self
pub fn github(client_id: &str, client_secret: &str) -> Self
Sourcepub fn github_with_endpoints(
client_id: &str,
client_secret: &str,
auth_url: &str,
token_url: &str,
user_info_url: &str,
user_emails_url: &str,
) -> Self
pub fn github_with_endpoints( client_id: &str, client_secret: &str, auth_url: &str, token_url: &str, user_info_url: &str, user_emails_url: &str, ) -> Self
Construct a GitHub provider using custom endpoints.
This keeps the built-in GitHub semantics while allowing local test harnesses or GitHub Enterprise-style deployments to override the URLs.
pub fn discord(client_id: &str, client_secret: &str) -> Self
Trait Implementations§
Source§impl Clone for OAuthProvider
impl Clone for OAuthProvider
Source§fn clone(&self) -> OAuthProvider
fn clone(&self) -> OAuthProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for OAuthProvider
impl !UnwindSafe for OAuthProvider
impl Freeze for OAuthProvider
impl Send for OAuthProvider
impl Sync for OAuthProvider
impl Unpin for OAuthProvider
impl UnsafeUnpin for OAuthProvider
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more