pub struct OAuthProvider {Show 22 fields
pub client_id: String,
pub additional_client_ids: Vec<String>,
pub hosted_domain: Option<String>,
pub require_email_verification: bool,
pub client_secret: String,
pub auth_url: String,
pub token_url: String,
pub user_info_url: Option<String>,
pub scopes: Vec<String>,
pub authorization: Option<OAuthAuthorizationPolicy>,
pub authorization_params: Vec<(String, String)>,
pub account_subject: Option<OAuthAccountSubject>,
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 id_token: Option<OAuthIdTokenConfig>,
pub disable_id_token_sign_in: bool,
pub disable_implicit_sign_up: bool,
pub disable_sign_up: bool,
pub allow_idp_initiated: bool,
pub override_user_info_on_sign_in: bool,
}Expand description
Configuration for a single OAuth provider.
Fields§
§client_id: String§additional_client_ids: Vec<String>Additional Google client IDs accepted when verifying ID tokens.
hosted_domain: Option<String>Google Workspace domain restriction, independently of authorization parameters.
require_email_verification: boolRequire a verified provider email before creating the authentication session.
client_secret: String§auth_url: String§token_url: String§user_info_url: Option<String>§scopes: Vec<String>Built-in authorization behavior. None preserves custom-provider behavior.
scopes remains the provider’s base scope list; this policy adds configured
and request scopes in the provider’s published order.
account_subject: Option<OAuthAccountSubject>Selects the factory account subject from the original provider profile.
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>>Application override takes precedence over the trusted built-in JWKS policy.
id_token: Option<OAuthIdTokenConfig>§disable_id_token_sign_in: boolDisable the complete ID-token branch, including an application verifier override.
disable_implicit_sign_up: bool§disable_sign_up: bool§allow_idp_initiated: boolStart a new state-bound authorization flow for a callback without state.
override_user_info_on_sign_in: boolImplementations§
Source§impl OAuthProvider
impl OAuthProvider
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.
Source§impl OAuthProvider
impl OAuthProvider
Sourcepub fn gitlab(client_id: &str, client_secret: &str) -> Self
pub fn gitlab(client_id: &str, client_secret: &str) -> Self
GitLab.com social login with the published read_user scope and PKCE.
Sourcepub fn gitlab_with_issuer(
client_id: &str,
client_secret: &str,
issuer: &str,
) -> Self
pub fn gitlab_with_issuer( client_id: &str, client_secret: &str, issuer: &str, ) -> Self
GitLab social login hosted at an application-configured issuer.
The issuer may include a deployment path. Repeated path slashes follow the pinned provider’s endpoint construction rather than URL resolution.
Source§impl OAuthProvider
impl OAuthProvider
Source§impl OAuthProvider
impl OAuthProvider
pub fn roblox(client_id: &str, client_secret: Option<&str>) -> Self
pub fn roblox_with_options(options: RobloxOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn salesforce(client_id: &str, client_secret: Option<&str>) -> Self
pub fn salesforce_with_options(options: SalesforceOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn slack(client_id: &str, client_secret: Option<&str>) -> Self
pub fn slack_with_options(options: SlackOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn spotify(client_id: &str, client_secret: Option<&str>) -> Self
pub fn spotify_with_options(options: SpotifyOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn tiktok(client_key: &str, client_secret: &str) -> Self
pub fn tiktok_with_options(options: TikTokOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn twitch(client_id: &str, client_secret: Option<&str>) -> Self
pub fn twitch_with_options(options: TwitchOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn twitter(client_id: &str, client_secret: Option<&str>) -> Self
pub fn twitter_with_options(options: TwitterOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn vercel(client_id: &str, client_secret: Option<&str>) -> Self
pub fn vercel_with_options(options: VercelOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
Source§impl OAuthProvider
impl OAuthProvider
pub fn wechat(client_id: &str, client_secret: &str) -> Self
pub fn wechat_with_options(options: WeChatOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn zoom(client_id: &str, client_secret: Option<&str>) -> Self
pub fn zoom_with_options(options: ZoomOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn reddit(client_id: &str, client_secret: Option<&str>) -> Self
pub fn reddit_with_options(options: RedditOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn railway(client_id: &str, client_secret: Option<&str>) -> Self
pub fn railway_with_options(options: RailwayOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn paypal(client_id: &str, client_secret: &str) -> Self
pub fn paypal_with_options(options: PayPalOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn paybin(client_id: &str, client_secret: Option<&str>) -> Self
pub fn paybin_with_options(options: PaybinOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn polar(client_id: &str, client_secret: Option<&str>) -> Self
pub fn polar_with_options(options: PolarOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn notion(client_id: &str, client_secret: Option<&str>) -> Self
pub fn notion_with_options(options: NotionOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn cloudflare(client_id: &str, client_secret: Option<&str>) -> Self
pub fn cloudflare_with_options(options: CloudflareOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
Source§impl OAuthProvider
impl OAuthProvider
pub fn dropbox(client_id: &str, client_secret: Option<&str>) -> Self
pub fn dropbox_with_options(options: DropboxOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn figma(client_id: &str, client_secret: Option<&str>) -> Self
pub fn figma_with_options(options: FigmaOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn facebook(client_id: &str, client_secret: &str) -> Self
pub fn facebook_with_options(options: FacebookOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn atlassian(client_id: &str, client_secret: &str) -> Self
pub fn atlassian_with_options(options: AtlassianOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn apple(client_id: &str, client_secret: &str) -> Self
pub fn apple_with_options(options: AppleOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
Source§impl OAuthProvider
impl OAuthProvider
pub fn huggingface(client_id: &str, client_secret: Option<&str>) -> Self
pub fn huggingface_with_options(options: HuggingFaceOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn kakao(client_id: &str, client_secret: Option<&str>) -> Self
pub fn kakao_with_options(options: KakaoOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn kick(client_id: &str, client_secret: Option<&str>) -> Self
pub fn kick_with_options(options: KickOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn line(client_id: &str, client_secret: Option<&str>) -> Self
pub fn line_with_options(options: LineOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
Source§impl OAuthProvider
impl OAuthProvider
pub fn linkedin(client_id: &str, client_secret: Option<&str>) -> Self
pub fn linkedin_with_options(options: LinkedInOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
pub fn linear(client_id: &str, client_secret: Option<&str>) -> Self
pub fn linear_with_options(options: LinearOptions) -> Self
Source§impl OAuthProvider
impl OAuthProvider
Sourcepub fn with_profile_mapper(self, mapper: Arc<dyn OAuthProfileMapper>) -> Self
pub fn with_profile_mapper(self, mapper: Arc<dyn OAuthProfileMapper>) -> Self
Install asynchronous partial mapping on the dedicated factory’s profile handler. Installing a custom userinfo handler afterwards replaces both the default transport and mapping, matching getUserInfo precedence.