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
3 answers

Register with unique email OR unique username in ASP.NET Core MVC

I am working on a system that should allow users to register by a unique username, or unique email. Register by both is possible as well. I am using the default identity pages with some modifications, here is a sample of the register code: …
3
votes
2 answers

Layout for Identity/Account/Manage pages broken after scaffolding full .Net Identity UI source

I'm following along to these to guides: Scaffold Identity into an MVC project without existing authorization Create full Identity UI source After following the 1st guide I get what I expect for the Identity/Account/Manage pages: However, after…
br3nt
  • 9,017
  • 3
  • 42
  • 63
3
votes
1 answer

Where to find a source "Authorizing..." message comes from in a Blazor Web Assembly app?

In a simple Blazor Web Assembly App created in Visual Studio with the "Individual User Accounts" option enabled, there is a message "Authorizing..." that appears on page loading: In an attempt to change its representation, I'm struggling to find…
Anthony
  • 2,715
  • 5
  • 26
  • 34
3
votes
1 answer

Multiple Login Page with Identity Core and Asp.net Core 3.1

I Have an Asp.net Core Application with 2 areas, each area has its own login page. I use this code to redirect the user to the login page : services.AddAuthentication(opt => { opt.DefaultScheme = "AdminAuth";}) …
3
votes
1 answer

ASP.NET and OWIN Cookies Azure Open ID is not working

I have try to use OpenID to connect with Azure AD, and I use the exact code from the tutorial https://learn.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-asp-webapp with no luck. My Startup: public class Startup { string…
Hiyasat
  • 8,601
  • 7
  • 33
  • 59
3
votes
2 answers

Unable to set scopes with EnableTokenAcquisitionToCallDownstreamApi with AddMicrosoftIdentityWebApiAuthentication

This compiles in startup.cs: string[] initialScopes = Configuration.GetValue("GraphApi:Scopes")?.Split(' '); services.AddMicrosoftIdentityWebAppAuthentication(Configuration) …
3
votes
0 answers

Persist ASP.NET Core 3.1 identity external login authentication cookie across sessions

I'm using ASP.NET Core Identity in my .NET Core 3.1 project and having a hard time figuring out how to persist cookies created from external login providers such as Microsoft or Google across sessions. So far the cookie is always a session cookie…
Oliver Weichhold
  • 10,259
  • 5
  • 45
  • 87
3
votes
1 answer

Add New Role in AspNetRoles Table Identity

How to Add New Role in AspNetRoles Table in Identity? var roleresult = UserManager.AddToRole(currentUser.Id, "Admin"); I am using the above code to assign Admin role to the user, but it throws an error "Role Admin does not exist." I have tried to…
3
votes
0 answers

IdentityServer and user management- should those concerns be kept separate?

Since IdentityServer's object is to provide authentication and authorization via implementing OIDC and OAuth2 it makes sense to me that user management (CRUD operations) is done separately, maybe in it's own assembly (these seem like two different…
3
votes
0 answers

Setting SameSite cookie attribute for auth cookie generated by asp.net identity (below NET 4.7.2)

I got bitten by the SameSite cookie attribute enforcement in Google Chrome few days ago. My problem is that I am on .NET 4.7.1 and upgrading the .NET Framework is "ticket based" so the lead time is prohibitive. The site itself uses ASPNET Identity…
msuhash
  • 266
  • 3
  • 12
3
votes
1 answer

SqlException: Invalid column name 'NormalizedName'. Invalid column name 'ConcurrencyStamp'. Invalid column name 'NormalizedName'

Why am I getting exception when using PasswordSignInAsync on .NET Core Identity? Microsoft.AspNetCore.Identity await _signInManager.PasswordSignInAsync(user.UserName, Input.Password, Input.RememberMe, lockoutOnFailure: false); An unhandled…
Manny
  • 31
  • 1
  • 2
3
votes
2 answers

Asp.Net Core Identity - simple Authorization without Roles table

I'm trying to develop a simple user authorization mechanism for my application, without using a specific Roles table. The User entity has a simple Role enum property, and I would like to properly decorate the Authorize attribute on some…
3
votes
1 answer

Cannot access a disposed object.\r\nObject name: 'UserManager`1 - while calling CreateAsync(user, model.password)

I am working on .net core porject. My Project structure has 4 projects. Student_Database - (Contains Database table model and ApplicatinDBContext) Student_Entities - (Contains All the View side models) Student_Service - (All the Database operation…
3
votes
1 answer

How to make Identityserver redirect to my web app?

i am trying to integrate Identity Server 4 with Ocelot and authenticate WebApp (asp.net core 3.1) then access the api if request is authenticated. for this i have created a solution having Gateway- Ocelot(latest) IdentityService - Identity Server…
3
votes
1 answer

How can I call '/Identity/Account/ExternalLogin' from a Blazor component?

My goal is to have the external provider buttons (exactly like the foreach from the /Identity/Account Login and Register pages, see below) in a Blazor component. I am using the "Blazor Server App" template. I have successfully pulled in the external…
1 2 3
99
100