pub struct OAuth2Auth { /* private fields */ }Expand description
OAuth2 authentication with refresh token support.
Implementations§
Source§impl OAuth2Auth
impl OAuth2Auth
Sourcepub fn new(
client_id: impl Into<String>,
client_secret: impl Into<String>,
scopes: Vec<String>,
) -> Self
pub fn new( client_id: impl Into<String>, client_secret: impl Into<String>, scopes: Vec<String>, ) -> Self
Create new OAuth2 auth.
Sourcepub fn with_token_store(self, store: Arc<dyn TokenStore>) -> Self
pub fn with_token_store(self, store: Arc<dyn TokenStore>) -> Self
Set token store for persistence.
Sourcepub fn with_token(self, token: Token) -> Self
pub fn with_token(self, token: Token) -> Self
Set initial token (e.g., from stored refresh token).
Generate authorization URL for user consent.
Trait Implementations§
Source§impl AuthStrategy for OAuth2Auth
impl AuthStrategy for OAuth2Auth
Auto Trait Implementations§
impl Freeze for OAuth2Auth
impl !RefUnwindSafe for OAuth2Auth
impl Send for OAuth2Auth
impl Sync for OAuth2Auth
impl Unpin for OAuth2Auth
impl !UnwindSafe for OAuth2Auth
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