Class AuthorizationCodePKCEFlow
java.lang.Object
de.sonallux.spotify.api.authorization.TokenStoreApiAuthorizationProvider
de.sonallux.spotify.api.authorization.authorization_code.AuthorizationCodePKCEFlow
- All Implemented Interfaces:
ApiAuthorizationProvider
-
Field Summary
Fields inherited from class de.sonallux.spotify.api.authorization.TokenStoreApiAuthorizationProvider
tokenStore -
Constructor Summary
ConstructorsConstructorDescriptionAuthorizationCodePKCEFlow(String clientId, String redirectUri) AuthorizationCodePKCEFlow(String clientId, String redirectUri, TokenStore tokenStore) -
Method Summary
Modifier and TypeMethodDescriptioncreateAuthorizationUrl(String codeChallenge) voidexchangeAuthorizationCode(AuthorizationRedirectResponse<String> authResponse, String codeVerifier) booleanCallback to initiate a token refresh after a 401 Unauthorized response from the Spotify Web API.Methods inherited from class de.sonallux.spotify.api.authorization.TokenStoreApiAuthorizationProvider
getAuthorizationHeaderValue
-
Constructor Details
-
AuthorizationCodePKCEFlow
-
AuthorizationCodePKCEFlow
-
-
Method Details
-
createAuthorizationUrl
-
exchangeAuthorizationCode
public void exchangeAuthorizationCode(AuthorizationRedirectResponse<String> authResponse, String codeVerifier) throws SpotifyAuthorizationException - Throws:
SpotifyAuthorizationException
-
refreshAccessToken
public boolean refreshAccessToken()Description copied from interface:ApiAuthorizationProviderCallback to initiate a token refresh after a 401 Unauthorized response from the Spotify Web API. If this operation is not supported or failed, returnfalse. A return value oftrueindicates that the failing request should be retried. TheApiAuthorizationProvider.getAuthorizationHeaderValue()method will be called again to get the new header with the new token- Specified by:
refreshAccessTokenin interfaceApiAuthorizationProvider- Overrides:
refreshAccessTokenin classTokenStoreApiAuthorizationProvider- Returns:
trueto indicate to successful token refresh, otherwisefalse
-
parseAuthorizationRedirectResponse
-