public string GetInvalidateBearerTokenQuery(IInvalidateBearerTokenParameters parameters) { var query = new StringBuilder(Resources.Auth_InvalidateBearerToken); query.AddFormattedParameterToQuery(parameters.FormattedCustomQueryParameters); return(query.ToString()); }
public void Validate(IInvalidateBearerTokenParameters parameters, ITwitterRequest request) { if (parameters == null) { throw new ArgumentNullException(nameof(parameters)); } var credentialsParameterName = $"client.Credentials"; var credentials = request.Query.TwitterCredentials; ThrowIfInvalidConsumerCredentials(credentialsParameterName, credentials); if (string.IsNullOrEmpty(credentials?.BearerToken)) { throw new ArgumentException("Cannot be null or empty", $"{credentialsParameterName}.{nameof(credentials.BearerToken)}"); } }
public void Validate(IInvalidateBearerTokenParameters parameters, ITwitterRequest request) { _authClientParametersValidator.Validate(parameters, request); }
public async Task <InvalidateTokenResponse> InvalidateBearerTokenAsync(IInvalidateBearerTokenParameters parameters) { var twitterResult = await _authRequester.InvalidateBearerTokenAsync(parameters).ConfigureAwait(false); return(twitterResult?.Model); }
public async Task <InvalidateTokenResponse> InvalidateBearerToken(IInvalidateBearerTokenParameters parameters) { var twitterResult = await _authRequester.InvalidateBearerToken(parameters).ConfigureAwait(false); return(twitterResult?.DataTransferObject); }
public Task <ITwitterResult <InvalidateTokenResponse> > InvalidateBearerToken(IInvalidateBearerTokenParameters parameters) { return(ExecuteRequest(request => { _validator.Validate(parameters, request); return _authController.InvalidateBearerToken(parameters, request); })); }
public Task <ITwitterResult <InvalidateTokenResponse> > InvalidateBearerTokenAsync(IInvalidateBearerTokenParameters parameters, ITwitterRequest request) { var oAuthWebRequestGenerator = _oAuthWebRequestGeneratorFactory.Create(); request.Query.Url = _queryGenerator.GetInvalidateBearerTokenQuery(parameters); request.Query.HttpMethod = HttpMethod.POST; request.TwitterClientHandler = new InvalidateTokenHttpHandler(oAuthWebRequestGenerator); return(_twitterAccessor.ExecuteRequestAsync <InvalidateTokenResponse>(request)); }
public Task <ITwitterResult <InvalidateTokenResponse> > InvalidateBearerTokenAsync(IInvalidateBearerTokenParameters parameters, ITwitterRequest request) { return(_authQueryExecutor.InvalidateBearerTokenAsync(parameters, request)); }