コード例 #1
0
        public AuthenticationTicketProvider(ITokenHttpClient tokenHttpClient, IDateTimeOffsetProvider dateTimeOffsetProvider)
        {
            this.tokenHttpClient        = tokenHttpClient;
            this.dateTimeOffsetProvider = dateTimeOffsetProvider;

            this.semaphore = new SemaphoreSlim(1);
        }
コード例 #2
0
 public AuthenticationTicketProvider(
     IAuthenticationManager authenticationManager,
     IDateTimeOffsetProvider dateTimeOffsetProvider,
     ITokenHttpClient tokenHttpClient,
     IOptionsProvider <AspNetCoreAuthorizationCodeFlowOptions> optionsProvider)
 {
     this.authenticationManager  = authenticationManager;
     this.dateTimeOffsetProvider = dateTimeOffsetProvider;
     this.tokenHttpClient        = tokenHttpClient;
     this.optionsProvider        = optionsProvider;
 }
コード例 #3
0
 /// <summary>
 /// Gets the access token or throw invalid refresh token exception.
 /// </summary>
 /// <param name="tokenHttpClient">The token HTTP client.</param>
 /// <param name="refreshToken">The refresh token.</param>
 /// <param name="cancellationToken">The cancellation token.</param>
 /// <returns></returns>
 public static async Task <AccessTokenDto> GetAccessTokenOrThrowInvalidRefreshTokenExceptionAsync(
     this ITokenHttpClient tokenHttpClient,
     string refreshToken,
     CancellationToken cancellationToken)
 {
     try
     {
         return(await tokenHttpClient.GetAccessTokenFromRefreshTokenAsync(
                    refreshToken,
                    cancellationToken).ConfigureAwait(false));
     }
     catch (SpotifyHttpResponseWithAuthenticationErrorException e) when(
         e.ErrorCode == System.Net.HttpStatusCode.BadRequest &&
         "invalid_grant".Equals(e.Payload?.Error, StringComparison.OrdinalIgnoreCase))
     {
         throw new SpotifyInvalidRefreshTokenException(e);
     }
 }
コード例 #4
0
 public TokenService(IJSRuntime jsRuntimeCurrent, ITokenHttpClient httpClient)
 {
     this.JsRuntimeCurrent = jsRuntimeCurrent;
     this.HttpClient       = httpClient;
 }
コード例 #5
0
 public NaiveTokenProxyClient(ITokenHttpClient tokenHttpClient, IAuthorizationCallbackUriProvider authorizationCallbackUriProvider)
 {
     this.tokenHttpClient = tokenHttpClient;
     this.authorizationCallbackUriProvider = authorizationCallbackUriProvider;
 }
コード例 #6
0
 public OfficeService(ITokenHttpClient httpClient)
 {
     this.HttpClient = httpClient;
 }
コード例 #7
0
 public CakeMarkService(ITokenHttpClient httpClient)
 {
     this.HttpClient = httpClient;
 }
コード例 #8
0
 public UserService(ITokenHttpClient httpClient)
 {
     this.HttpClient = httpClient;
 }