pub struct Oidc<U> { /* private fields */ }Expand description
A panel’s provider sign-in, installed with Auth::oidc: a button on the login and sign-up
pages for each OidcProvider, which leaves for the provider and comes back signed in as the
user the IdentityLinker names.
A provider sign-in ends as a password one does: an account with a second factor answers the
two-factor challenge, and a new session replaces the browser’s. It needs the router’s cookie
Key, which seals the sign-in’s secrets while the browser is at the provider.
let auth = Auth::password().oidc(
Oidc::new("https://app.example.com", Linker)
.provider(OidcProvider::google("client-id", "client-secret")),
);Implementations§
Source§impl<U: PanelUser> Oidc<U>
impl<U: PanelUser> Oidc<U>
Sourcepub fn new(
base_url: impl Into<String>,
linker: impl IdentityLinker<User = U>,
) -> Self
pub fn new( base_url: impl Into<String>, linker: impl IdentityLinker<User = U>, ) -> Self
Signs users in through linker, with redirect URIs that start with base_url, such as
https://app.example.com: the app’s public origin, never one a request names. Add each
provider with provider.
The pending sign-in’s cookie belongs to the host the browser started on, and the provider
sends it back to base_url’s: serve the panel on that host alone, redirecting any other,
such as www., to it, or a sign-in started there comes back without its cookie and
fails.
Sourcepub fn provider(self, provider: OidcProvider) -> Self
pub fn provider(self, provider: OidcProvider) -> Self
Adds provider’s button, after the providers added before it.