Beispiel #1
0
        /// <inheritdoc />
        public Authorization(IOptions <JwtIssuerOptions> jwtOptions, ILogger <Authorization> logger, IMediator mediator, IOptions <MobileSecurityOptions> mobileSecurityOptions)
        {
            _jwtOptions = jwtOptions.Value;
            ThrowIfInvalidOptions(_jwtOptions);

            _logger   = logger;
            _mediator = mediator;
            _mobileSecurityOptions = mobileSecurityOptions.Value;
        }
Beispiel #2
0
        /// <inheritdoc />
        public Authorization(IOptions <JwtIssuerOptions> jwtOptions, ILogger <Authorization> logger, IMediator mediator,
                             IOptions <MobileSecurityOptions> mobileSecurityOptions, IAuthy authy, IAccountService accountService)
        {
            _jwtOptions = jwtOptions.Value;
            ThrowIfInvalidOptions(_jwtOptions);

            _logger   = logger;
            _mediator = mediator;
            _mobileSecurityOptions = mobileSecurityOptions.Value;
            _authy          = authy;
            _accountService = accountService;
        }
        /// <inheritdoc />
        public Authorization(IOptions <JwtIssuerOptions> jwtOptions, ILogger logger, IMediator mediator, IOptions <MobileSecurityOptions> mobileSecurityOptions)
        {
            _jwtOptions = jwtOptions.Value;
            ThrowIfInvalidOptions(_jwtOptions);

            _logger   = logger;
            _mediator = mediator;
            _mobileSecurityOptions = mobileSecurityOptions.Value;

            _serializerSettings = new JsonSerializerSettings
            {
                Formatting = Formatting.Indented
            };
        }
 /// <summary>
 /// Constructor for dependency injection
 /// </summary>
 /// <param name="context">The EntityFramework context</param>
 /// <param name="hash">Implementation of the IHashService to be used to generate the hashes. It can either be `HashService` or `ClearTextService`.</param>
 /// <param name="mobileSecurityOptions">Options for specifying the DeviceLock feature toggle. If MobileSecurity:LockDevice is enabled (set to `true` in settings), the first login of the observer will store the UniqueDeviceId and only that device will be allowed to login.</param>
 public ObserverAuthenticationQueryHandler(VotingContext context, IHashService hash, IOptions <MobileSecurityOptions> mobileSecurityOptions)
 {
     _context = context;
     _hash    = hash;
     _mobileSecurityOptions = mobileSecurityOptions.Value;
 }