Questions tagged [asp.net-identity]

The ASP.NET Identity system is designed to replace the previous ASP.NET Membership and Simple Membership systems.

The ASP.NET Identity system is designed to replace the previous ASP.NET Membership and Simple Membership systems. It includes profile support, OAuth integration, works with OWIN, and is included with the ASP.NET templates shipped with Visual Studio 2013.

ASP.NET Identity uses code-first Entity Framework to allow for maximum customization through class manipulation, annotation, and new fluent API.

Useful links

8860 questions
3
votes
1 answer

Alternative Asp.NET Core Authentication Framework

I have searched here as well as google, but couldn't find a clear answer. I am curious if there are any good alternative frameworks for handling authentication/authorization in the manner that Identity does for ASP.NET core. The standard Identity…
3
votes
2 answers

Blazor WebAssembly 401 Unauthorized even when I am authorized

I am using Blazor WebAssembly Asp.Net Core hosted PWAand integrated the AspNetCore.Identity into it. I created the AuthenticationStateProvider in the Client-Side and now I want to allow the user access to a controller where he needs to be…
brstkr
  • 1,423
  • 3
  • 18
  • 28
3
votes
2 answers

Google Authentication get user profile picture

If user is authenticated via google, I need to get his profile picture. If user is authenticated via facebook I get his profile picture with this code: var info = await _signInManager.GetExternalLoginInfoAsync(); var identifier =…
Roomey
  • 716
  • 2
  • 9
  • 16
3
votes
1 answer

After updating the identity server 4 4.0.0 from 3.1.4 Scope is invalid asp.net core 3 with Mongo DB

In the discovery document, the scope IdentityPortal.API is not added { "issuer": "https://localhost:5001", "scopes_supported": ["profile", "openid", "email", "offline_access"], } However, allowed scope in the config is as below private…
San Jaisy
  • 15,327
  • 34
  • 171
  • 290
3
votes
1 answer

How to add tables and relations to generated Asp.Net Core MVC Identity database?

I have a project where I have to make an ASP.NET Core MVC Web Application in which I should include user sign up, login, and an SQL database with basic CRUD operations and corresponding views. For login and signup I decided to use Asp.Net Core…
Yopa
  • 61
  • 3
  • 10
3
votes
1 answer

ASP.NET Core JWT authentication changes Claims (sub)

I have an ASP.NET Core API which uses JWT Authentication. Simple setup: .... string authority = $"https://{configuration["Auth:Authority"]}"; string audience = configuration["Auth:Audience"]; return builder.AddJwtBearer(options => { …
Luke1988
  • 1,850
  • 2
  • 24
  • 42
3
votes
0 answers

How to populate user related data in IdentityServer4 on email confirmation

I have created a project scaffolded by Visual Studio 2019 using Angular and MVC Rest API using C# and .NET Core with Entity Framework. I selected to use IdentityServer4 to register and confirm user emails. With this you also get password reset…
3
votes
1 answer

How does .net core web api jwtbearer middleware verify OpenID Connect token with authentication provider

I have been banging my head against the wall for a few days now. The solution is probably too simple to state in blogs so I ask the question here. I am developing a .NET Core Web API which should delegate all authentication and authorization to a…
3
votes
2 answers

How to set JwtBearerOptions dynamically?

I'm developing a multi-tenant application with asp.net core 3.1 as the backend. I used JWT to authenticate users. I'm passing the tenantId along with the http request and I would like to validate JWT against tenantIds. To do this, I must pass the…
3
votes
1 answer

How to change JWT timeout for dotnet core SPA (Angular) with Identity Server

I'm using dotnet core 3, and trying to set the JWT expire time, and can't find where to do so. I know it can be done where the JWT token is created, but that's happening in one of Microsoft's libraries. Anybody out there know how this can be…
3
votes
1 answer

How to get purpose field for userManager.VerifyUserTokenAsync?

When I'm trying to reset a password, I'm using userManager.VerifyUserTokenAsync(user, tokenProvider, purpose, token) but it always returns false. My suspicion is that the purpose field is wrong but I'm not sure what should actually go there. My…
roonz11
  • 795
  • 1
  • 13
  • 24
3
votes
0 answers

userManager.GetRolesAsync(user) returns empty list after extending IdentityRole

I needed to add a List property to IdentityRole in order to establish a Many-to-Many relationship. After doing this and running code-first migration, everything seemed fine. However now when I try and pull roles for a user, the result is always…
roonz11
  • 795
  • 1
  • 13
  • 24
3
votes
1 answer

Blazor + MongoDb Identity: Value cannot be null. (Parameter name 'source')

Could you help me. I am trying to use Blazor with MongoDb Identity and always get Exception: Value cannot be null. (Parameter name 'source') when I call signInManager.SignInAsync(user, false); MongoDB server version: 4.2.5 ASP.Net Core 3.1 NuGet…
3
votes
2 answers

User.Identity.Name is null in my ASP.NET Core Web API

I have added ASP.NET Core identity and Identity Server4 in one project with one database, and I want to use my Identity Server in all other project. IdentityServer4 Startup Class public class Startup { public IConfigurationRoot Config { get;…
mohsen
  • 1,763
  • 3
  • 17
  • 55
3
votes
1 answer

Asp.Net 3.1 using Windows Authentication and Role Authorisation

setup with Asp.net & .Net Core 3.1, I have upgraded a previous Identity system using UserName/Password with Roles to use Windows Authentication. I have created a ClaimsTransformation which gets the windows Identity and creates a new ClaimsPrincipal…
1 2 3
99
100