예제 #1
0
        public Startup(IConfiguration configuration)
        {
            this.Configuration = configuration;

            this.CrossOriginSettings = configuration.GetSection("CrossOriginSettings")
                                       .Get <CrossOriginSettings>();

            this.JwtSecuritySettings = configuration.GetSection("JwtSecuritySettings")
                                       .Get <JwtSecuritySettings>();
        }
예제 #2
0
 public TokenService(
     IOptions <JwtSettings> jwtSettings,
     IOptions <JwtSecuritySettings> jwtSecuritySettings,
     UserManager <AppUser> userManager,
     IHttpContextAccessor contextAccessor)
 {
     _jwtSettings         = jwtSettings?.Value ?? throw new ArgumentNullException(nameof(jwtSettings));
     _jwtSecuritySettings = jwtSecuritySettings?.Value ?? throw new ArgumentNullException(nameof(jwtSecuritySettings));
     _userManager         = userManager ?? throw new ArgumentNullException(nameof(userManager));
     _contextAccessor     = contextAccessor ?? throw new ArgumentNullException(nameof(contextAccessor));
 }
예제 #3
0
 public AuthController(UserManager <User> userManager,
                       SignInManager <User> signInManager,
                       IOptions <JwtSecuritySettings> jwtSettings,
                       UserTokenRepository tokenRepository,
                       ILogger <AuthController> logger)
 {
     this.userManager     = userManager;
     this.passwordHasher  = userManager.PasswordHasher;
     this.jwtSettings     = jwtSettings.Value;
     this.logger          = logger;
     this.tokenRepository = tokenRepository;
 }
예제 #4
0
 public AuthService([NotNull] JwtSecuritySettings securitySettings)
 {
     _securitySettings = securitySettings ?? throw new ArgumentNullException(nameof(securitySettings));
 }