Skip to main content

rustauth_social_providers/
lib.rs

1//! Server-side social OAuth provider definitions for RustAuth.
2//!
3//! # Application setup
4//!
5//! ```rust
6//! use rustauth_social_providers::providers::github;
7//! use rustauth_social_providers::SocialProviderConfig;
8//!
9//! # fn example() -> Result<(), rustauth_oauth::oauth2::OAuthError> {
10//! let github = github(SocialProviderConfig::new("client-id", "client-secret"))?;
11//! # let _ = github;
12//! # Ok(())
13//! # }
14//! ```
15//!
16//! When credentials come from separate sources, use the builder:
17//!
18//! ```rust
19//! use rustauth_social_providers::providers::github;
20//! use rustauth_social_providers::SocialProviderConfig;
21//!
22//! # fn example(client_id: String, client_secret: String) -> Result<(), rustauth_oauth::oauth2::OAuthError> {
23//! let github = github(
24//!     SocialProviderConfig::builder()
25//!         .client_id(client_id)
26//!         .client_secret(client_secret)
27//!         .scope(["read:user"])
28//!         .build()?,
29//! );
30//! # let _ = github;
31//! # Ok(())
32//! # }
33//! ```
34//!
35//! Register the returned provider with `RustAuthOptions::social_provider`.
36//!
37//! Low-level OAuth request types, endpoint constants, profile structs, and HTTP
38//! primitives live under [`advanced`].
39
40mod apple;
41mod atlassian;
42mod cognito;
43mod discord;
44mod dropbox;
45mod facebook;
46mod figma;
47mod github;
48mod gitlab;
49mod google;
50mod huggingface;
51mod kakao;
52mod kick;
53mod line;
54mod linear;
55mod linkedin;
56mod microsoft_entra_id;
57mod naver;
58mod notion;
59mod paybin;
60mod paypal;
61mod polar;
62mod railway;
63mod reddit;
64mod roblox;
65mod runtime;
66mod salesforce;
67mod slack;
68mod spotify;
69mod tiktok;
70mod twitch;
71mod twitter;
72mod vercel;
73mod vk;
74mod wechat;
75mod zoom;
76
77mod config;
78mod http;
79
80pub mod advanced;
81pub mod providers;
82
83pub use config::{
84    CognitoPoolConfig, ProviderId, SocialProviderConfig, SocialProviderConfigBuilder,
85};
86pub use runtime::ProviderIdentity;
87
88pub const PROVIDER_IDS: &[&str] = &[
89    "apple",
90    "atlassian",
91    "cognito",
92    "discord",
93    "facebook",
94    "figma",
95    "github",
96    "microsoft",
97    "google",
98    "huggingface",
99    "slack",
100    "spotify",
101    "twitch",
102    "twitter",
103    "dropbox",
104    "kick",
105    "linear",
106    "linkedin",
107    "gitlab",
108    "tiktok",
109    "reddit",
110    "roblox",
111    "salesforce",
112    "vk",
113    "zoom",
114    "notion",
115    "kakao",
116    "naver",
117    "line",
118    "paybin",
119    "paypal",
120    "polar",
121    "railway",
122    "vercel",
123    "wechat",
124];
125
126/// Current crate version.
127pub const VERSION: &str = env!("CARGO_PKG_VERSION");