Beispiel #1
0
 public MyAccountController(
     ExtendedIdentityDbContext <User, Role> dbContext,
     ExtendedUserManager <User> userManager,
     IConfiguration configuration,
     IdentityServerApiEndpointsOptions identityServerApiEndpointsOptions,
     IEmailService emailService,
     IPlatformEventService eventService,
     IOptions <GeneralSettings> generalSettings,
     IOptionsSnapshot <IdentityOptions> identityOptions,
     ISmsServiceFactory smsServiceFactory,
     ExtendedConfigurationDbContext configurationDbContext,
     IPersistedGrantStore persistedGrantStore,
     IPersistentGrantSerializer serializer
     )
 {
     _configuration   = configuration ?? throw new ArgumentNullException(nameof(configuration));
     _dbContext       = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
     _emailService    = emailService;
     _eventService    = eventService ?? throw new ArgumentNullException(nameof(eventService));
     _generalSettings = generalSettings?.Value ?? throw new ArgumentNullException(nameof(generalSettings));
     _identityOptions = identityOptions?.Value ?? throw new ArgumentNullException(nameof(identityOptions));
     _identityServerApiEndpointsOptions = identityServerApiEndpointsOptions ?? throw new ArgumentNullException(nameof(identityServerApiEndpointsOptions));
     _smsServiceFactory      = smsServiceFactory ?? throw new ArgumentNullException(nameof(smsServiceFactory));
     _userManager            = userManager ?? throw new ArgumentNullException(nameof(userManager));
     _configurationDbContext = configurationDbContext ?? throw new ArgumentNullException(nameof(configurationDbContext));
     _persistedGrantStore    = persistedGrantStore ?? throw new ArgumentNullException(nameof(persistedGrantStore));
     _serializer             = serializer ?? throw new ArgumentNullException(nameof(serializer));
 }
Beispiel #2
0
 /// <summary>
 /// Constructs the <see cref="TotpService"/>.
 /// </summary>
 /// <param name="userManager">Provides the APIs for managing user in a persistence store.</param>
 /// <param name="smsServiceFactory">Sms Service Factory</param>
 /// <param name="pushNotificationService">Push Notification service</param>
 /// <param name="distributedCache">Represents a distributed cache of serialized values.</param>
 /// <param name="localizer">Represents a service that provides localized strings.</param>
 /// <param name="logger">Represents a type used to perform logging.</param>
 /// <param name="rfc6238AuthenticationService">Time-Based One-Time Password Algorithm service.</param>
 public TotpService(
     UserManager <User> userManager,
     ISmsServiceFactory smsServiceFactory,
     IPushNotificationService pushNotificationService,
     IDistributedCache distributedCache,
     IStringLocalizer <TotpService> localizer,
     ILogger <TotpService> logger,
     Rfc6238AuthenticationService rfc6238AuthenticationService
     )
 {
     _userManager             = userManager ?? throw new ArgumentNullException(nameof(userManager));
     _smsServiceFactory       = smsServiceFactory ?? throw new ArgumentNullException(nameof(smsServiceFactory));
     _pushNotificationService = pushNotificationService;
     _cache     = distributedCache ?? throw new ArgumentNullException(nameof(distributedCache));
     _localizer = localizer ?? throw new ArgumentNullException(nameof(localizer));
     _logger    = logger ?? throw new ArgumentNullException(nameof(logger));
     _rfc6238AuthenticationService = rfc6238AuthenticationService ?? throw new ArgumentNullException(nameof(rfc6238AuthenticationService));
 }