Beispiel #1
0
 public AuthenticationService(IUserService userService, ITokenHandler tokenHandle, IOptions <CustomTokenOptions> tokenOptions, UserManager <AppUser> _userManager, SignInManager <AppUser> _signInManager, RoleManager <AppRole> _roleManager)
     : base(_userManager, _signInManager, _roleManager)
 {
     _tokenHandle  = tokenHandle;
     _tokenOptions = tokenOptions.Value;
     _userService  = userService;
 }
Beispiel #2
0
 public AuthenticationService(ITokenHandler tokenHandler, IUserService userService,
                              IOptions <CustomTokenOptions> options, UserManager <AppUser> userManager,
                              SignInManager <AppUser> signInManager, RoleManager <AppUser> roleManager) : base(userManager, signInManager, roleManager)
 {
     this.tokenHandler       = tokenHandler;
     this.userService        = userService;
     this.customTokenOptions = options.Value;
 }
Beispiel #3
0
 public static void AddCustomTokenAuth(this IServiceCollection services, CustomTokenOptions tokenOptions)
 {
     services.AddAuthentication(options =>
     {
         options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
         options.DefaultChallengeScheme    = JwtBearerDefaults.AuthenticationScheme;
     }).AddJwtBearer(JwtBearerDefaults.AuthenticationScheme, opts =>
     {
         opts.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters()
         {
             ValidIssuer              = tokenOptions.Issuer,
             ValidAudience            = tokenOptions.Audience[0],
             IssuerSigningKey         = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(tokenOptions.SecurityKey)),
             ValidateIssuerSigningKey = true,
             ValidateAudience         = true,
             ValidateIssuer           = true,
             ValidateLifetime         = true,
             ClockSkew = TimeSpan.Zero
         };
     });
 }
Beispiel #4
0
 public CustomTokenService(UserManager <Cavus> kullanici, IOptions <CustomTokenOptions> options)
 {
     _kullanici          = kullanici;
     _customTokenOptions = options.Value;
 }
 public TokenService(UserManager <Customer> userManager, IOptions <CustomTokenOptions> options)
 {
     _userManager = userManager;
     _tokenOption = options.Value;
 }
Beispiel #6
0
 public SeedData(UserManager <ApplicationUser> userManger, SignInManager <ApplicationUser> signInManager, CustomTokenOptions tokenOptions)
 {
     _userManager   = userManger;
     _signInManager = signInManager;
     _tokenOptions  = tokenOptions;
 }
Beispiel #7
0
 public TokenService(UserManager <UserApp> userManager, IOptions <CustomTokenOptions> options)
 {
     _userManager        = userManager;
     _customTokenOptions = options.Value;
 }