public Startup(IConfiguration configuration) { this.Configuration = configuration; this.CrossOriginSettings = configuration.GetSection("CrossOriginSettings") .Get <CrossOriginSettings>(); this.JwtSecuritySettings = configuration.GetSection("JwtSecuritySettings") .Get <JwtSecuritySettings>(); }
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)); }
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; }
public AuthService([NotNull] JwtSecuritySettings securitySettings) { _securitySettings = securitySettings ?? throw new ArgumentNullException(nameof(securitySettings)); }