Questions tagged [asp.net-identity-3]

The third release of the ASP.NET Identity system which was designed to replace the previous ASP.NET Membership and Simple Membership systems. Use this tag if your question deals specifically to ASP.NET Identity 3 features. The [asp.net-identity] tag should be used if your question is not specific to ASP.NET Identity 3.

225 questions
7
votes
1 answer

AuthorizationHandler and database dependency injection

We develop an multi-tenant application based on Identity authentication. Each user get a token session, stored in database, to tell if the user is still connected (with expiration time). I store the token (and others informations about the user…
7
votes
2 answers

Asp.Net core MVC6 How to initially add roles in Identity 3

I've looked for this in Stackoverflow and so far it appears there are plenty of questions on adding roles in Identity 1 & 2 but its different in Identity 3. I want to seed roles in the database. I have just two. I intended to use _roleManager which…
si2030
  • 3,895
  • 8
  • 38
  • 87
6
votes
0 answers

Refresh Signin & Reload claims

I am storing the user selected culture into the user claims and i have a custom RequestCultureProvider that reads this value and set the request culture accordingly. The application will have a profile page where the user can change his preferences…
6
votes
0 answers

IdentityServer4 - Session Management and idle timeout or period of inactivity

I have configured an IdentityServer with several clients, some of them are native applications using the Hybrid flow (Desktop, iOS, doesn't really matter). I want to force a logout on a user who's inactive for over X minutes, and if possible to…
6
votes
1 answer

How to change Web Api Core unauthorized behavior

The default ASP.NET Web Api Core behaviour for unauthorized request is to send 401/403 error with empty content. I'd like to change it by specifying some kind of Json response specifying the error. But I struggle to find a right place where I can…
SiberianGuy
  • 24,674
  • 56
  • 152
  • 266
6
votes
2 answers

Creating a new AuthorizationHandler/IAuthorizationRequirement that uses a service

I am trying to create a new Authorization requirement, but it must use one of the services that I declare in ConfigureServices, and I have no idea how to pass that service to the new requirement in the same method as declaring the service. public…
Matthew
  • 276
  • 2
  • 3
  • 15
6
votes
1 answer

ASP.NET Core Identity - Extending Password Hasher

I'm working towards moving an application from Web Forms to MVC and opted to go with MVC 6 using ASP.NET Core. In my current application I have a custom password hasher used with Identity. The implementation is very simple in my custom UserManager…
Mat H.
  • 363
  • 1
  • 3
  • 11
6
votes
3 answers

ASP.NET Identity 2 to 3

Right, so..I think I'm confused!! I have a few ASP.NET MVC 5 sites running using ASP.NET Identity 2.1 and everything is great. I am creating a new MVC 6 site and I would like the users to use there existing credentials that they use for other…
6
votes
2 answers

Redirect Login to Controller Action

Starting with the ASP.NET 5 Web App Template using Individual User Accounts I have managed to get external authentication working with Microsoft accounts. When users click Login they are redirected to ExternalLogin in AccountController like…
6
votes
1 answer

What is the equivalent for IIdentityMessageService on ASP.NET Identity 3.0?

On ASP.NET Identity 2.X we could configure a notification infrastructure trhough the IIdentityMessageService interface available at the Microsoft.AspNet.Identity.Core library, which was not upgraded to version 3.0. What are the practices for…
Minduca
  • 1,121
  • 9
  • 19
6
votes
1 answer

How do I tell UserManager.FindByNameAsync to include a relation?

I am using ASP.NET Identity 2.2.0 with ASP.NET MVC 5.2.3 and Entity Framework 6.1.2. I added a new property and its corresponding table to my database using ASP.NET Identity with Code First like so: public class ApplicationUser { …
Water Cooler v2
  • 32,724
  • 54
  • 166
  • 336
5
votes
3 answers

How to make custom user claims be available in API requests

I have a solution consisting of: ASP.NET Core 2.1 running IdentityServer4 on top of ASP.NET Identity Core. ASP.NET Core 2.1 Web API set to use the IdentityServer as the authentication provider. A React SPA web application using oidc-client…
empz
  • 11,509
  • 16
  • 65
  • 106
5
votes
2 answers

.Net Identity 2 vs 3

I understand .NET Identity, but lots of articles are coming up about Identity 2 and Identity 3. The latter (Identity 3) seems to only work for .NET Core solutions. So was thinking of using Identity 2. But I'm not clear: What are the difference…
5
votes
1 answer

When should HttpContext.User.Identity.IsAuthenticated and SignInManager.IsSignedIn(HttpContext.User) be used?

There seems to be some ambiguity about these 2. I use them interchangeably throughout my project and the only reason is because I couldn't figure out when to use one or the other. What would be the cases where one is true while the other one…
Dealdiane
  • 3,984
  • 1
  • 24
  • 35
5
votes
1 answer

ASP.NET Core Identity 3 Cookie timeout

I have a weird issue happening with RC2. I have setup Identity 3 ExpireTimeSpan to 12 hours using the following configuration option options.Cookies.ApplicationCookie.ExpireTimeSpan = new TimeSpan(12,0,0); After logging in to the website and…
1 2
3
14 15