pub struct FakeProvider { /* private fields */ }Expand description
An OpenID Connect provider serving its discovery document and token endpoint on a loopback
port, which a panel’s OidcProvider reaches as it would a real one.
The browser’s visit to the provider is authorize: it reads the
authorization URL the panel redirected to and answers the callback the provider would send
the browser back to. The token endpoint checks the client’s secret, the PKCE verifier and the
redirect URI, takes each code once, and issues an ID token carrying the nonce the panel sent.
Implementations§
Source§impl FakeProvider
impl FakeProvider
Sourcepub async fn start(client_id: &str, client_secret: &str) -> Self
pub async fn start(client_id: &str, client_secret: &str) -> Self
A provider for the client client_id with client_secret, listening on a free loopback
port until dropped.
§Panics
When no loopback port is free.
Sourcepub fn provider(&self, key: &str) -> OidcProvider
pub fn provider(&self, key: &str) -> OidcProvider
This provider as a panel installs it, under key, labelled key.
Signs account in at location, the authorization URL a panel redirected the browser
to, and answers the path and query the provider sends the browser back to.
§Panics
When location is not this provider’s authorization URL for its client, or asks for no
PKCE S256 challenge.