public static Task <TResponse> VerifyRecaptchaAsync <TResponse>(this IRecaptchaHttpClient httpClient, RecaptchaConfiguration configuration, HttpRequest request, IRecaptchaTokenProvider tokenProvider) where TResponse : IRecaptchaResponse { return(httpClient.VerifyRecaptchaAsync <TResponse>(configuration.Secret, tokenProvider.GetToken(request), request.HttpContext.Connection.RemoteIpAddress)); }
public static async Task <TResponse> VerifyRecaptchaAsync <TResponse>(this IRecaptchaHttpClient httpClient, string secret, string clientResponse, IPAddress remoteIp) where TResponse : IRecaptchaResponse { return((TResponse)await httpClient.VerifyRecaptchaAsync(typeof(TResponse), secret, clientResponse, remoteIp.ToString())); }
public InnerAttribute(IRecaptchaTokenProvider tokenProvider, IRecaptchaConfigurationProvider configurationProvider, IRecaptchaHttpClient recaptchaHttpClient, IRecaptchaConfigurationStore configurationStore) { this.tokenProvider = tokenProvider ?? throw new ArgumentNullException(nameof(tokenProvider)); this.configurationProvider = configurationProvider ?? throw new ArgumentNullException(nameof(configurationProvider)); this.recaptchaHttpClient = recaptchaHttpClient ?? throw new ArgumentNullException(nameof(recaptchaHttpClient)); this.configurationStore = configurationStore ?? throw new ArgumentNullException(nameof(configurationStore)); }
public static Task <IRecaptchaResponse> VerifyRecaptchaAsync(this IRecaptchaHttpClient httpClient, Type type, string secret, string clientResponse, IPAddress remoteIp) { return(httpClient.VerifyRecaptchaAsync(type, secret, clientResponse, remoteIp.ToString())); }