1#![cfg_attr(docsrs, feature(doc_cfg))]
45#![warn(missing_docs)]
46
47pub mod errors;
48pub mod types;
49
50mod auth_url;
52pub mod cache;
53mod client;
54mod dcr;
55mod discovery;
56mod exchange;
57pub mod http;
58mod id_token;
59mod introspect;
60mod jwks;
61mod pkce;
62mod userinfo;
63
64pub mod tenant;
66pub mod discovery_tenant;
67pub mod http_tenant;
68
69#[cfg(feature = "verifier")]
71mod verify;
72
73#[cfg(not(target_arch = "wasm32"))]
75pub mod sse;
76
77pub use auth_url::{
79 build_auth_url, build_auth_url_with_metadata, build_end_session_url,
80 build_end_session_url_with_discovery, parse_callback_params,
81};
82pub use cache::{Cache, NoOpCache, MemoryCache};
83
84#[cfg(feature = "lru")]
85pub use cache::LruCacheImpl;
86
87#[cfg(all(not(target_arch = "wasm32"), feature = "moka"))]
88pub use cache::MokaCacheImpl;
89
90#[cfg(all(not(target_arch = "wasm32"), feature = "http-reqwest", feature = "moka"))]
91pub use client::OidcClient;
92
93#[cfg(not(target_arch = "wasm32"))]
94pub use dcr::{register_client, get_client_config};
95
96pub use discovery::discover;
97pub use errors::Error;
98
99#[cfg(not(target_arch = "wasm32"))]
100pub use exchange::{exchange_code, refresh_token};
101
102pub use http::{HttpClient, HttpClientError};
103pub use id_token::fetch_jwks;
104
105#[cfg(all(not(target_arch = "wasm32"), feature = "http-reqwest"))]
106pub use http::ReqwestHttpClient;
107
108#[cfg(all(target_arch = "wasm32", feature = "http-wasm"))]
109pub use http::WasmHttpClient;
110
111pub use id_token::verify_id_token;
112#[cfg(not(target_arch = "wasm32"))]
113pub use introspect::{introspect_token, revoke_token};
114pub use jwks::{Jwk, Jwks};
115pub use pkce::create_pkce;
116pub use types::*;
117pub use userinfo::get_userinfo;
118
119#[cfg(feature = "verifier")]
120pub use verify::JwtVerifier;
121
122pub const VERSION: &str = env!("CARGO_PKG_VERSION");
125
126pub mod prelude {
128 pub use crate::{
129 build_auth_url, build_end_session_url, build_end_session_url_with_discovery,
130 create_pkce, discover, parse_callback_params, verify_id_token, AuthUrlResult, BuildAuthUrl,
131 CallbackParams, EndSession, Error, OidcProviderMetadata, TokenResponse,
132 VerifiedIdToken, VerifyOptions,
133 };
134
135 pub use crate::{
137 tenant::{TenantConfig, TenantMode, TenantResolution},
138 discovery_tenant::{discover_with_tenant, discover_with_tenant_simple, discover_with_tenant_resolution},
139 http_tenant::{HttpClientWithAdminSupport, HttpClientAdapter},
140 };
141
142 #[cfg(all(not(target_arch = "wasm32"), feature = "http-reqwest"))]
143 pub use crate::http_tenant::reqwest_tenant::ReqwestHttpClientWithAdminSupport;
144
145 #[cfg(not(target_arch = "wasm32"))]
146 pub use crate::{
147 exchange_code, refresh_token, register_client, get_client_config,
148 introspect_token, revoke_token,
149 ExchangeCode, RefreshTokenRequest, RegisterRequest,
150 IntrospectRequest, IntrospectResponse, ClientConfig,
151 };
152
153 pub use crate::{get_userinfo, UserInfo};
154
155 #[cfg(feature = "verifier")]
156 pub use crate::{JwtVerifier, VerifiedClaims};
157
158 #[cfg(all(not(target_arch = "wasm32"), feature = "sse"))]
160 pub use crate::sse::{
161 start_login_session, check_login_status, subscribe_login_events,
162 LoginStatus, LoginState, LoginEvent, LoginMonitorConfig,
163 };
164}