Spotify Auth Manager
High-level authorization manager for Spotify Accounts flows.
Handles PKCE state/verifier lifecycle, code exchange, token refresh, and token caching.
Functions
Clears the currently stored token and expiration state.
Completes PKCE authorization by exchanging the authorization code.
Completes PKCE authorization by parsing the Spotify callback URI and exchanging the code.
Exchanges an authorization code for tokens and stores the token set.
Exchanges an authorization code for tokens using PKCE and stores the token set.
Returns the currently stored token response.
Returns a valid access token, refreshing it when necessary.
Launches the Spotify authorization URL using in-app auth UI or browser.
Refreshes the current access token using the stored refresh token.
Requests a client-credentials token and stores the token set.
Starts Authorization Code with PKCE flow and returns authorization request data.
Starts Authorization Code with PKCE flow and launches the authorization URL.
Starts Authorization Code with PKCE flow asynchronously.
Starts Authorization Code with PKCE flow asynchronously and launches the authorization URL.