pub struct OidcConfig {
pub provider: OidcProvider,
pub client_id: String,
pub client_secret: String,
pub redirect_uri: String,
pub scopes: Vec<String>,
pub post_login_redirect: String,
}sso only.Expand description
All parameters needed to perform an OIDC / OAuth 2.0 authorization flow.
Fields§
§provider: OidcProviderProvider endpoint URLs.
client_id: StringOAuth client ID.
client_secret: StringOAuth client secret (empty for PKCE-only public clients).
redirect_uri: StringRedirect URI registered with the identity provider.
scopes: Vec<String>Requested OAuth scopes.
post_login_redirect: StringPath to redirect to after a successful login.
Implementations§
Source§impl OidcConfig
impl OidcConfig
Sourcepub fn google(
client_id: &str,
client_secret: &str,
redirect_uri: &str,
) -> OidcConfig
pub fn google( client_id: &str, client_secret: &str, redirect_uri: &str, ) -> OidcConfig
Google OIDC configuration.
Sourcepub fn microsoft(
tenant_id: &str,
client_id: &str,
client_secret: &str,
redirect_uri: &str,
) -> OidcConfig
pub fn microsoft( tenant_id: &str, client_id: &str, client_secret: &str, redirect_uri: &str, ) -> OidcConfig
Microsoft Entra ID / Azure AD configuration.
tenant_id can be a GUID, "common", "organizations", or "consumers".
Sourcepub fn github(
client_id: &str,
client_secret: &str,
redirect_uri: &str,
) -> OidcConfig
pub fn github( client_id: &str, client_secret: &str, redirect_uri: &str, ) -> OidcConfig
GitHub OAuth 2.0 configuration.
Sourcepub fn okta(
domain: &str,
client_id: &str,
client_secret: &str,
redirect_uri: &str,
) -> OidcConfig
pub fn okta( domain: &str, client_id: &str, client_secret: &str, redirect_uri: &str, ) -> OidcConfig
Okta configuration.
domain is your Okta org URL, e.g. "dev-12345.okta.com".
Sourcepub fn auth0(
domain: &str,
client_id: &str,
client_secret: &str,
redirect_uri: &str,
) -> OidcConfig
pub fn auth0( domain: &str, client_id: &str, client_secret: &str, redirect_uri: &str, ) -> OidcConfig
Auth0 configuration.
domain is your Auth0 domain, e.g. "myapp.us.auth0.com".
Sourcepub fn keycloak(
base_url: &str,
realm: &str,
client_id: &str,
client_secret: &str,
redirect_uri: &str,
) -> OidcConfig
pub fn keycloak( base_url: &str, realm: &str, client_id: &str, client_secret: &str, redirect_uri: &str, ) -> OidcConfig
Keycloak configuration.
Sourcepub fn discover(
issuer: &str,
client_id: &str,
client_secret: &str,
redirect_uri: &str,
) -> Result<OidcConfig, SsoError>
pub fn discover( issuer: &str, client_id: &str, client_secret: &str, redirect_uri: &str, ) -> Result<OidcConfig, SsoError>
Discover a custom OIDC provider via {issuer}/.well-known/openid-configuration.
Sourcepub fn from_env() -> Result<OidcConfig, SsoError>
pub fn from_env() -> Result<OidcConfig, SsoError>
Load configuration from environment variables.
Required variables:
RWS_OIDC_PROVIDER—google,github,microsoft,okta,auth0,keycloak, orcustomRWS_OIDC_CLIENT_IDRWS_OIDC_REDIRECT_URI
Optional variables:
RWS_OIDC_CLIENT_SECRET(default: empty)RWS_OIDC_ISSUER— required forokta,auth0,keycloak,customRWS_OIDC_TENANT_ID— required formicrosoft(tenant) andkeycloak(realm)RWS_OIDC_SCOPES— space-separated (default:openid email profile)RWS_OIDC_POST_LOGIN_REDIRECT(default:/)
Sourcepub fn post_login_redirect(self, path: &str) -> OidcConfig
pub fn post_login_redirect(self, path: &str) -> OidcConfig
Override the post-login redirect path (default: "/").
Sourcepub fn scopes(
self,
scopes: impl IntoIterator<Item = impl Into<String>>,
) -> OidcConfig
pub fn scopes( self, scopes: impl IntoIterator<Item = impl Into<String>>, ) -> OidcConfig
Override the requested scopes.
Trait Implementations§
Source§impl Clone for OidcConfig
impl Clone for OidcConfig
Source§fn clone(&self) -> OidcConfig
fn clone(&self) -> OidcConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for OidcConfig
impl RefUnwindSafe for OidcConfig
impl Send for OidcConfig
impl Sync for OidcConfig
impl Unpin for OidcConfig
impl UnsafeUnpin for OidcConfig
impl UnwindSafe for OidcConfig
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
map-response-body only.Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
trace only.Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
trace only.