Class TwilioVerificationServiceCollectionExtensions
- Namespace
- NuvTools.Security.Verification.Twilio.Extensions
- Assembly
- NuvTools.Security.Verification.Twilio.dll
Extension methods for registering the phone verification services.
public static class TwilioVerificationServiceCollectionExtensions
- Inheritance
-
TwilioVerificationServiceCollectionExtensions
- Inherited Members
Methods
AddTwilioPhoneVerification(IServiceCollection, IConfiguration, string, int)
Binds TwilioVerifyOptions from configuration and registers Twilio Verify as the IPhoneVerifier, with its own HttpClient.
public static IServiceCollection AddTwilioPhoneVerification(this IServiceCollection services, IConfiguration configuration, string sectionName = "TwilioVerify", int timeoutInSeconds = 30)
Parameters
servicesIServiceCollectionThe service collection to add the services to.
configurationIConfigurationConfiguration holding the Twilio Verify section.
sectionNamestringName of the section to bind. Defaults to SectionName; pass the application's own when its settings already live under another name.
timeoutInSecondsintTimeout of each call to Twilio. Defaults to 30 seconds.
Returns
- IServiceCollection
The service collection for chaining.
Remarks
This is the only place a caller names the provider: everything above it depends on IPhoneVerifier, so changing provider is changing this call.