pub struct AuthorizationCodeFlow { /* private fields */ }Expand description
Authorization Code Flow for OAuth2.
This flow is suitable for applications that can open a browser and receive the authorization code via redirect.
Implementations§
Source§impl AuthorizationCodeFlow
impl AuthorizationCodeFlow
Sourcepub const fn new(client: OAuthClient) -> Self
pub const fn new(client: OAuthClient) -> Self
Creates a new authorization code flow.
Sourcepub fn with_pkce(self) -> Self
pub fn with_pkce(self) -> Self
Enables PKCE for enhanced security (recommended for public clients).
Builds the authorization URL for user consent.
The user should be redirected to this URL to authorize the application.
§Arguments
scopes- Optional scopes to request (uses provider defaults if None)state- Optional state parameter for CSRF protection
§Errors
Returns an error if the URL cannot be constructed.
Sourcepub fn pkce_verifier(&self) -> Option<&str>
pub fn pkce_verifier(&self) -> Option<&str>
Returns the PKCE verifier if PKCE is enabled.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AuthorizationCodeFlow
impl !UnwindSafe for AuthorizationCodeFlow
impl Freeze for AuthorizationCodeFlow
impl Send for AuthorizationCodeFlow
impl Sync for AuthorizationCodeFlow
impl Unpin for AuthorizationCodeFlow
impl UnsafeUnpin for AuthorizationCodeFlow
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
Mutably borrows from an owned value. Read more