OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
spotify.spotify_auth.SpotifyAuth Class Reference

Provide Spotify OAuth 2.0 authorization using PKCE. More...

Public Member Functions

str redirect_uri (self)
 Return the configured OAuth redirect URI.
str get_access_token (self)
 Return a valid Spotify access token, authorizing when needed.
SpotifyAuthorizationRequest begin_authorization (self)
 Create a transport-independent Spotify authorization request.
OAuthTokens complete_authorization (self, SpotifyAuthorizationRequest request, *, str|None code, str|None state, str|None error=None, str|None error_description=None)
 Validate an OAuth callback, exchange its code, and store tokens.
OAuthTokens login (self, *, Callable[[], bool] is_current=lambda:True)
 Run the desktop flow while its owner remains active.
OAuthTokens refresh (self, str refresh_token)
 Refresh and persist a Spotify access token.

Detailed Description

Provide Spotify OAuth 2.0 authorization using PKCE.

Member Function Documentation

◆ login()

OAuthTokens spotify.spotify_auth.SpotifyAuth.login ( self,
* ,
Callable[[], bool] is_current = lambda: True )

Run the desktop flow while its owner remains active.

Parameters
is_currentWhether authorization is still wanted.
Returns
Authorized tokens.

The documentation for this class was generated from the following file:
  • protocols/spotify/spotify_auth.py