예제 #1
0
        /// <inheritdoc/>
        public async Task <IAuthenticationResponse> EnrollFactorAsync(EnrollCallFactorOptions factorOptions, CancellationToken cancellationToken = default)
        {
            var profile = new Resource();

            profile.SetProperty("phoneNumber", factorOptions.PhoneNumber);
            profile.SetProperty("phoneExtension", factorOptions.PhoneExtension);

            var enrollCallFactor = new EnrollFactorRequest()
            {
                StateToken = factorOptions.StateToken,
                FactorType = FactorType.Call,
                Provider   = factorOptions.Provider,
                Profile    = profile,
            };

            return(await EnrollFactorAsync(enrollCallFactor, cancellationToken));
        }
예제 #2
0
        /// <inheritdoc/>
        public async Task <IAuthenticationResponse> ResendCallEnrollFactorAsync(EnrollCallFactorOptions factorOptions, CancellationToken cancellationToken = default)
        {
            var profile = new Resource();

            profile.SetProperty("phoneNumber", factorOptions.PhoneNumber);
            profile.SetProperty("phoneExtension", factorOptions.PhoneExtension);

            var enrollCallFactor = new EnrollFactorRequest()
            {
                StateToken = factorOptions.StateToken,
                FactorType = FactorType.Call,
                Provider   = factorOptions.Provider,
                Profile    = profile,
            };

            return(await PostAsync <AuthenticationResponse>(
                       new HttpRequest
            {
                Uri = $"/api/v1/authn/factors/{factorOptions.FactorId}/lifecycle/resend",
                Payload = enrollCallFactor,
            }, cancellationToken).ConfigureAwait(false));
        }