Class SimpleApiAuthorizationProvider

    • Constructor Detail

      • SimpleApiAuthorizationProvider

        public SimpleApiAuthorizationProvider()
    • Method Detail

      • getAuthorizationHeaderValue

        public String getAuthorizationHeaderValue()
        Description copied from interface: ApiAuthorizationProvider
        Get the value for the Authorization header 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 no Authorization header should be added to the request null can be returned.
        Specified by:
        getAuthorizationHeaderValue in interface ApiAuthorizationProvider
        Returns:
        the value of the Authorization header or null
      • refreshAccessToken

        public boolean refreshAccessToken()
        Description copied from interface: ApiAuthorizationProvider
        Callback to initiate a token refresh after a 401 Unauthorized response from the Spotify Web API. If this operation is not supported or failed, return false. A return value of true indicates that the failing request should be retried. The ApiAuthorizationProvider.getAuthorizationHeaderValue() method will be called again to get the new header with the new token
        Specified by:
        refreshAccessToken in interface ApiAuthorizationProvider
        Returns:
        true to indicate to successful token refresh, otherwise false