Skip to main content

init_with_oauth

Function init_with_oauth 

Source
pub async fn init_with_oauth(
    admin_endpoint: Option<Url>,
    client_id: Option<&str>,
) -> Result<AppPassword, Error>
Expand description

Logs in through the admin endpoint’s OAuth authorization server in the default web browser, then creates an app password with the resulting access token.

This is the authorization code flow for native apps (RFC 8252) with PKCE (RFC 7636). The browser only carries a single-use authorization code, which cannot be redeemed without code_verifier, and code_verifier never leaves this process. The app password is created over a direct HTTPS request.

Without client_id, a client is registered for this login through dynamic client registration (RFC 7591), with this login’s exact redirect URI.