/// <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)); }
/// <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)); }