pub struct OAuthFlow { /* private fields */ }Expand description
OAuth flow configuration and execution.
Handles the complete OAuth 2.0 Authorization Code flow with PKCE.
Implementations§
Source§impl OAuthFlow
impl OAuthFlow
Sourcepub fn new(client_id: String) -> Self
pub fn new(client_id: String) -> Self
Create a new OAuth flow with the given Spotify client ID.
Uses default scopes and port 8888 for the callback server.
Sourcepub fn with_scopes(self, scopes: Vec<String>) -> Self
pub fn with_scopes(self, scopes: Vec<String>) -> Self
Override the default scopes.
Sourcepub async fn authenticate(&self) -> Result<Token, OAuthError>
pub async fn authenticate(&self) -> Result<Token, OAuthError>
Execute the full OAuth flow.
- Generates PKCE challenge
- Opens browser to Spotify authorization page
- Waits for callback with authorization code
- Exchanges code for tokens
Auto Trait Implementations§
impl Freeze for OAuthFlow
impl RefUnwindSafe for OAuthFlow
impl Send for OAuthFlow
impl Sync for OAuthFlow
impl Unpin for OAuthFlow
impl UnwindSafe for OAuthFlow
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