Questions tagged [asp.net-core-identity]

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

887 questions
18
votes
2 answers

How to sign out other user in ASP.NET Core Identity

How can i sign out another user (not the currently logged one) in ASP.NET Core Identity. I know there is a SignOutAsync() method in SignInManager, but there seems to be no override accepting user as argument. I'm looking for something…
Mariusz Jamro
  • 27,234
  • 22
  • 104
  • 144
17
votes
5 answers

How to use Roles in ASP.NET Core 2.1?

I've created a test project using: dotnet new razor --auth Individual --output Test This creates a Startup.cs that contains: public void ConfigureServices(IServiceCollection services) { services.Configure(options => { …
Alan T
  • 3,084
  • 6
  • 24
  • 26
17
votes
1 answer

Could we destroy/invalidate JWT token in Asp.NET Core?

I use ASP.NET Core & ASP.NET core Identity to generate a JWT token. On the client-side, my React (SPA) app calls API to create the token then include Authorization: Bearer token from API in subrequests. When I want to logout, how can I immediately…
17
votes
1 answer

How to create an identity server for users without consent page?

We have an internal application for internal users which I need to protect using OAuth2/OIDC and thinking of using IdentityServer4. The end users will not be authorizing any applications so there shouldn't be any consent page. I couldn't find any…
16
votes
3 answers

Multiple Identities in ASP.NET Core 2.0

I am migrating an ASP.NET Core 1.0 application to ASP.NET Core 2.0. In my startup I am configuring two identities: services.AddIdentity(configureIdentity) .AddDefaultTokenProviders() …
keith
  • 4,636
  • 1
  • 16
  • 41
15
votes
3 answers

IdentityServer4 + Asp.Net Core Identity - Map Identity to application database user

I am trying to implement an IdentityServer4 with Asp.Net Core Identity. I want to use IdentityServer4 as centralized authentication/authorization point for APIs using always the same identity. So the idea is to store the Asp.Net Core Identity stuff…
15
votes
8 answers

ASP.Net Core localization

ASP.Net core features new support for localization. In my project I need only one language. For most of the text and annotations I can specify things in my language, but for text coming from ASP.Net Core itself the language is…
14
votes
1 answer

The type or namespace name 'IWebHostEnvironment' could not be found (are you missing a using directive or an assembly reference?)

I am using .NET Core 3.0.100 ; Microsoft Visual Studio Community 2019 Preview Version 16.4.0 Preview 1.0 ; Blazor-server (official release). I am trying to add Authentication and Authorization to my Blazor-server web app. I am reading guideline at…
14
votes
1 answer

ASP.NET Core Identity with Windows Authentication

I'm using .NET Core 3.0 Preview6. We have an Intranet application with enabled Windows authentication which means that only valid AD users are allowed to use the application. However, we like to run our own authentication backend with ASP.NET…
Sven
  • 1,576
  • 1
  • 15
  • 35
14
votes
3 answers

.net core identity 2.1 role authorize not working

I've implemented role based auth several times pre 2.1. Followed the steps to scaffold the new 2.1 identities. I extended the IdentityUser model to add additional fields, login works fine, new fields are present. startup.cs configure services…
cdurth
  • 325
  • 1
  • 2
  • 12
14
votes
2 answers

What is Asp.net Core 2.1 Identity's LockoutEnabled property actually for?

I'm using Asp.net Core 2.1 Identity and there is a property named "LockoutEnabled", for a second I thought this flag determines whether a user is locked out or not.  But the doc says it is "a flag indicating if the user could be locked out" So…
Ray
  • 11,211
  • 23
  • 84
  • 128
14
votes
3 answers

User.Identity.Name is empty in Asp.NET Core 2.0 API Controller

I am new to ASP.NET core itself. However, I am creating WebAPIs in ASP.NET Core 2.0. I have configured JWT Bearer Token based authentication. Below is my Controller which return token. [AllowAnonymous] [Route("api/[controller]")] public class…
13
votes
10 answers

HTTP Error 500.30 - ANCM In-Process Start Failure error in ASP.NET Core 2.2

I am configuring this application Confirming the account and recovering passwords in ASP.NET Core but I have an error: HTTP Error 500.30 - ANCM In-Process Start Failure Common causes of this issue: The application failed to start The application…
13
votes
1 answer

Multitenant Identity Server 4

I'm trying to implement an IdentityServer that handles an SSO for a multitenant application. Our system will have only one IdentityServer4 instance to handle the authentication of a multitentant client. On the client side, I'm using the acr_value to…
13
votes
2 answers

IdentityServer4: Add Custom default Claim to Client Principal for Client_Credential Granttype

I am using IdentityServer4 and I am trying to add a custom default claim to my CLIENT when the token is created. This is possible if i use the implicit flow and IProfileService like shown below. public class MyProfileService : IProfileService { …
1
2
3
59 60