Esempio n. 1
0
        public static Task <AuthorizationCodeRefreshResponse> RequestToken(
            TokenSwapRefreshRequest request, IAPIConnector apiConnector
            )
        {
            Ensure.ArgumentNotNull(request, nameof(request));
            Ensure.ArgumentNotNull(apiConnector, nameof(apiConnector));

            var form = new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>("refresh_token", request.RefreshToken)
            };

#pragma warning disable CA2000
            return(apiConnector.Post <AuthorizationCodeRefreshResponse>(
                       request.RefreshUri, null, new FormUrlEncodedContent(form)
                       ));

#pragma warning restore CA2000
        }
Esempio n. 2
0
 /// <summary>
 /// Gets a refreshed access token using an already received refresh token using a remote server
 /// </summary>
 /// <param name="request"></param>
 /// <remarks>
 /// https://developer.spotify.com/documentation/ios/guides/token-swap-and-refresh/
 /// </remarks>
 /// <returns></returns>
 public Task <AuthorizationCodeRefreshResponse> RequestToken(TokenSwapRefreshRequest request)
 {
     return(RequestToken(request, API));
 }