pub struct OAuth2Client {
pub config: OAuth2Config,
/* private fields */
}Expand description
An OAuth2 stub client that manages the PKCE flow.
Fields§
§config: OAuth2ConfigImplementations§
Source§impl OAuth2Client
impl OAuth2Client
Sourcepub fn new(config: OAuth2Config) -> Self
pub fn new(config: OAuth2Config) -> Self
Creates a new OAuth2 client from config.
Sourcepub fn start_pkce_flow(&mut self, verifier: &str, state: &str) -> String
pub fn start_pkce_flow(&mut self, verifier: &str, state: &str) -> String
Starts the PKCE flow, returning the authorization URL.
Sourcepub fn complete_flow(&mut self, code: &str) -> Result<OAuth2Token, String>
pub fn complete_flow(&mut self, code: &str) -> Result<OAuth2Token, String>
Completes the PKCE flow by exchanging the auth code.
Auto Trait Implementations§
impl Freeze for OAuth2Client
impl RefUnwindSafe for OAuth2Client
impl Send for OAuth2Client
impl Sync for OAuth2Client
impl Unpin for OAuth2Client
impl UnsafeUnpin for OAuth2Client
impl UnwindSafe for OAuth2Client
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