Questions tagged [asp.net-core-identity]

Use ASP.NET Core Identity to add login functionality to an ASP.NET Core application.

887 questions
12
votes
1 answer

Adding identity server authentication to .NET Core 3 app fails with 'Key type not specified.'

I'm trying to add identity server authentication to a .NET Core 3 API project. I've added this code public void ConfigureServices(IServiceCollection services) { … var identityBuilder = services.AddIdentityServer(); …
12
votes
1 answer

Validate authentication cookie with ASP.NET Core 2.1 / 3+ Identity

When using Cookie Authentication in ASP.NET Core 2 (with or without Identity) it might happen, that a user's email or name is changed, or even the account is deleted during the cookie's lifetime. That's why the docs point out, that the cookie should…
12
votes
1 answer

Role Claims in ASP.NET Core Identity compared to Role Permissions in custom auth

Lets step away from ASP.NET Identity for a sec and lets say we are building a custom authentication/authorization system for our application. It will contain the following tables for full…
Blake Rivell
  • 10,899
  • 23
  • 93
  • 182
11
votes
1 answer

How to use both Azure AD authentication and Identity on ASP.NET Core 3?

The web application should allow internal employees with AD accounts to authenticate in the app using Azure AD Authentication. External users should be able to register and sign in using ASP.NET Core Identity. I can implement each one separately but…
Jossean Yamil
  • 199
  • 2
  • 7
11
votes
3 answers

How to translate Identity Password validation messages

So far I have been able to translate everything in an ASP.Net Core 2.1 Web Application. It has proven a little challenge, since the scaffolded Account Pages needed a little setup. But what I cannot find is a way to translate the Password validation…
Samo
  • 1,354
  • 13
  • 15
11
votes
1 answer

IdentityServer4 Signing Key, Validation Key and .Net Core Data Protection

The Identity Server 4 documentation (here http://docs.identityserver.io/en/latest/topics/crypto.html?highlight=data%20protection ) discusses signing keys and validation keys. I know that the signing key is configured…
11
votes
6 answers

Asp.net core Identity successful login redirecting back to login page

I have a problem where the asp.net identity framework is redirecting the user back to the login page after they have logged in successfully. This is using the standard Asp.net Core Identity. It is the version 2.1.1. The scaffolding that generates…
Jero
  • 143
  • 1
  • 6
11
votes
3 answers

ASP.NET Core 2 API call is redirected (302)

I'm trying to migrate this project https://github.com/asadsahi/AspNetCoreSpa from .net core 1.1 to 2.0 but have a problem after a successful login. After the login my GET api calls e. g. to https://localhost:44331/api/profile/test end up with a…
11
votes
1 answer

Authorize user based on API-key supplied in request header in ASP.NET Core

I'm trying to rewrite some authorization I currently have for ASP.NET 4.6 in ASP.NET Core. I understand that Authorization has changed a bit, and I find it difficult to implement my very simple auth strategy in ASP.NET Core. My requirements: Every…
11
votes
1 answer

Refreshing claimsPrincipal after changing roles

I'm having some issues with changing role in dotnetcore identity. I have the following code. private async Task SetRoleToX(ClaimsPrincipal claimsPrincipal, string X) { var currentUser = await UserManager.GetUserAsync(claimsPrincipal); var…
Spaceman
  • 1,181
  • 11
  • 38
11
votes
1 answer

How to add additional claims to be included in the access_token using ASP.Net Identity with IdentityServer4

How to add additional claims to be included within the token? As soon as the API receives the bearer token, the User.Identity object gets populated with the following claims. [ { "key": "nbf", "value": "1484614344" }, { "key":…
11
votes
3 answers

Move identity to a class library ASP.Net Core

I have developed a new project based on ASP.Net core. I have moved all my EF code (Models,mappings, DbContext) into a dedicated DAL class library in order to follow the Single responsibility principle of the SOLID rules. However, I need now to add…
10
votes
2 answers

ASP.NET Identity UserManager UpdateAsync Removing Roles

There is a screen in our application that allows members of the Administrators role to edit user account details. Ultimately any user object is sent to the server and updated using: await userManager.UpdateAsync(user); This is working as expected…
Jammer
  • 9,134
  • 8
  • 56
  • 106
10
votes
2 answers

How to retrieve Claims Value in .Net Core 2.0

As it says in the title I have already assigned claims to the registered user, I am now trying to retrieve the claim value when the user logs into the application within the UserClaims table in sql server which I find a bit difficult to do as this…
10
votes
1 answer

How to confirm a phone number in ASP.Net Core 1.1MVC

I cannot figure out how to do a phone number confirmation in asp.net core 1.1 Identity service configuration contains explicit options to require confirmed email and/or phone number. It can be done the following way: services .AddIdentity
Alexandre A.
  • 1,007
  • 10
  • 22
1 2
3
59 60