pub async fn authorize(
config: &OAuthConfig,
cancel: Receiver<bool>,
clock: &dyn Clock,
) -> Result<OAuthTokens, OAuthError>Expand description
Open the user’s browser, wait for the OAuth callback, and exchange the authorization code for tokens.
Flow:
- Generate PKCE verifier + challenge
- Open browser to
auth_urlwith the required parameters - Spawn a one-shot HTTP server on
localhost:{redirect_port} - Wait for the callback with the authorization code
- Exchange the code for tokens at
token_url