ReCaptchaClient

Client which handles all ReCaptcha verifications.

Type: Class
Namespace: ReCaptcha.Desktop.WinUI.Client
Assembly: ReCaptcha.Desktop.WinUI
Inherits from: IReCaptchaClient

public class ReCaptchaBase : IReCaptchaBase

Constructors

Creates a new ReCaptchaClient.

public ReCaptchaClient(
    ReCaptchaConfig configuration,
    WindowConfig windowConfiguration)
ParameterDescription
ReCaptchaConfig configurationThe configuration the ReCaptchaClient should be created with.
WindowConfig windowConfigurationThe configuration the reCAPTCHA window will be created with.

Creates a new ReCaptchaClient with extendended logging functions

public ReCaptchaClient(
    ReCaptchaConfig configuration,
    WindowConfig windowConfiguration,
    ILogger<IReCaptchaClient> logger)
ParameterDescription
ReCaptchaConfig configurationThe configuration the ReCaptchaClient should be created with.
WindowConfig windowConfigurationThe configuration the reCAPTCHA window will be created with.
ILogger<IReCaptchaClient> loggerA logger from Dependency Injection with MVVM.

Properties

Configuration

The configuration used for this client.

Type: ReCaptchaConfig
Modifier: none
Default Value: none

WindowConfiguration

The window configuration used for this client.

Type: WindowConfig
Modifier: none
Default Value: none

VerificationRecieved

Fires when verifcation was recieved.

Type: EventHandler<VerificationRecievedEventArgs>?
Modifier: event

VerificationCancelled

Fires when verifcation was cancelled.

Type: EventHandler<VerificationCancelledEventArgs>?
Modifier: event

ReCaptchaResized

Fires when verifcation was cancelled.

Type: EventHandler<ReCaptchaResizedEventArgs>?
Modifier: event

Methods

VerifyAsync

Sets up the reCAPTCHA site and opens a new window for the user to verify.

Returns: A Google reCAPTCHA token.

Task<string> VerifyAsync(
    CancellationToken cancellationToken = default!)
ParameterDescription
CancellationToken cancellationTokenThe token to cancel this action.