Interface ApiAuthorizationProvider
-
- All Known Implementing Classes:
AuthorizationCodeFlow,AuthorizationCodePKCEFlow,ClientCredentialsFlow,ImplicitGrantFlow,SimpleApiAuthorizationProvider,TokenStoreApiAuthorizationProvider
public interface ApiAuthorizationProvider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetAuthorizationHeaderValue()Get the value for theAuthorizationheader that should be added to a request.booleanrefreshAccessToken()Callback to initiate a token refresh after a 401 Unauthorized response from the Spotify Web API.
-
-
-
Method Detail
-
getAuthorizationHeaderValue
String getAuthorizationHeaderValue()
Get the value for theAuthorizationheader that should be added to a request. This method will be called for every request, so always the latest authentication token can be used. If noAuthorizationheader should be added to the requestnullcan be returned.- Returns:
- the value of the
Authorizationheader ornull
-
refreshAccessToken
boolean refreshAccessToken()
Callback 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. ThegetAuthorizationHeaderValue()method will be called again to get the new header with the new token- Returns:
trueto indicate to successful token refresh, otherwisefalse
-
-