Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keeping track of online users #1

Closed
SirwanAfifi opened this issue Jan 30, 2017 · 2 comments
Closed

Keeping track of online users #1

SirwanAfifi opened this issue Jan 30, 2017 · 2 comments

Comments

@SirwanAfifi
Copy link

SirwanAfifi commented Jan 30, 2017

Thanks for sharing the project. well-done 馃憤 馃憤

In my application I want to keep track of online users. Based on the project what I have found so far:

  • Adding appropriate field (LastVisitDateTime)
  • Customizing SecurityStampValidator<User>
  • Customizing SignInManager<User>
  • Registering appropriate services:
services.AddScoped<ISecurityStampValidator, CustomSecurityStampValidator>();
services.AddScoped<SecurityStampValidator<User>, CustomSecurityStampValidator>();

services.AddScoped<IApplicationSignInManager, ApplicationSignInManager>();
services.AddScoped<SignInManager<User>, ApplicationSignInManager>();

I just followed this process, but after log-in, the browser redirects me to a blank page, Here's my identity setup:

services.AddIdentity<User, IdentityRole>()
                .AddEntityFrameworkStores<AppDbContext>()
                .AddDefaultTokenProviders();

services.AddScoped<ISecurityStampValidator, CustomSecurityStampValidator>();
services.AddScoped<SecurityStampValidator<User>, CustomSecurityStampValidator>();

services.AddScoped<IApplicationSignInManager, ApplicationSignInManager>();
services.AddScoped<SignInManager<User>, ApplicationSignInManager>();

services.Configure<IdentityOptions>(options =>
{
       //options.Password.RequiredLength = 8;
       //options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromMinutes(30);                   
       //options.User.RequireUniqueEmail = true;
          options.Cookies.ApplicationCookie.AccessDeniedPath = new PathString("/Account/Login");
});

Is there something else to to?

@VahidN
Copy link
Owner

VahidN commented Jan 30, 2017

@lock
Copy link

lock bot commented Oct 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related problems.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants