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
4
votes
1 answer

Adding Scope, "wl.emails", to MicrosoftAccountAuthenticationOptions in Startup.Auth.cs causes issues

Please tell me what is wrong. public void ConfigureAuth(IAppBuilder app) { var mo = new MicrosoftAccountAuthenticationOptions(); mo.ClientId = "xxxxxxxxxxxxxxxxx"; mo.ClientSecret =…
4
votes
1 answer

Fastest way to get user's roles

U have an ASP.Net MVC 5 website and I want to retrieve current user's roles (if any) and act on them accordingly. I've noticed some changes, even after the Beta version of VS 2013 in the template. I'm currently using this code: //in Utilities.cs…
Alireza Noori
  • 14,961
  • 30
  • 95
  • 179
4
votes
2 answers

Need to change Asp.Net Identity (RTM) User Id from nvarchar(128) to uniqueidentifier

Using Asp.Net Identity 1.0 (RTM version). The default implementation creates an AspNetUsers table. The Id column type is nvarchar(128). When the database and tables are being created, I would simply like to change the type of the User Id to be…
user2315985
  • 2,848
  • 5
  • 17
  • 18
4
votes
5 answers

ASP.NET Identity How to I add a required property for a custom ApplicationUser?

I'm trying to add a Required property for ApplicationUser (ASP.NET Identity, MVC5) Here's a simple example: public class ApplicationUser : IdentityUser { [Required] public string FirstName { get; set; } } The field is created in the…
4
votes
1 answer

How to create a valid AuthenticationManager without a controller?

I need access to a valid instance of a AuthenticationManager outside of a controller. For example, in a custom AuthroizeAttribute. In the template used to create an MVC 5 application that uses ASP.NET Identity it creates this code in the…
Kevin Junghans
  • 17,475
  • 4
  • 45
  • 62
4
votes
1 answer

ASP.NET Identity DB Seed

I am trying to set up some seed data for my MVC 5 Web Application, but it doesn't seem to be creating any for IdentityUser. When I check the App_Data folder it's empty (Show All files is enabled) Here is my WebAppDatabaseInitializer.cs public class…
teh0wner
  • 1,393
  • 6
  • 16
  • 33
4
votes
1 answer

Transactions / Database.BeginTransaction and IdentityManager

I have a complex add process for creating a user(and adds roles + other user related information to other tables) Does anyone know how to use Transactions when adding a user/role or other Identity objects. I cannot seem to access…
Piotr Stulinski
  • 9,241
  • 8
  • 31
  • 46
4
votes
2 answers

Microsoft.AspNet.Identity - customize POCO class

I am struggling to add a few fields to the standard ApplicationUser object with the code below. I have successfully run Migrations and i can see the database scheme is updated with the new fields in the database. I followed the tutorial at…
Piotr Stulinski
  • 9,241
  • 8
  • 31
  • 46
4
votes
1 answer

What is the recommended way to run asp.net identity functions in transaction?

Using asp.net identity RTW version. I need to perform several actions in a transaction, including both UserMananger function calls and other operations on my DbContext (example: create new user, add it to group and perform some business-logic…
aleyush
  • 644
  • 1
  • 6
  • 19
4
votes
1 answer

Cant get 'UseOAuthBearerTokens' to work with Owin and Identity RTM

I use app.UseOAuthBearerTokens(OAuthOptions); and var options = new OAuthAuthorizationServerOptions { TokenEndpointPath = new Microsoft.Owin.PathString("/Token"), AuthorizeEndpointPath = new…
Poul K. Sørensen
  • 16,950
  • 21
  • 126
  • 283
4
votes
1 answer

Where could I get the rtm controller templates for asp.net identity?

I know it's not open source (yet) but anybody know how to make the latest rtm packages work or perhaps a controller template that I can use to try it out? It seems that it has changed significantly from the RC version.
knotans
  • 41
  • 2
4
votes
3 answers

Could not load type 'System.Data.Entity.DbSetExtensions' from assembly 'EntityFramework

Updated from entityframework 6.0.0-beta1 to 6.0.0-rc1 and when logging into my MVC5 application i get the following error {"Could not load type 'System.Data.Entity.DbSetExtensions' from assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral,…
Tim
  • 7,401
  • 13
  • 61
  • 102
3
votes
3 answers

ASP.NET Identity Cookie compatibility between .NET Core and .NET

My issue is that I would like to share the ASP.NET identity cookie between .NET Core and .NET I have the latest version of ASP.NET Identity in both places - the .NET Core is a new login page, the .NET is a legacy app that will be converted to .NET…
Philip Johnson
  • 1,091
  • 10
  • 24
3
votes
1 answer

"No authenticationScheme was specified, and there was no DefaultChallengeScheme found." when sending request without cookie

I'm making webapp with cookie-based authentication. I have login screen, backend sends cookie and then browser sends cookie with each requests. But when I try to reach secured endpoints (with or without cookie) instead of Unauthorized or OK, server…
Sha-1
  • 105
  • 1
  • 6
3
votes
2 answers

ASP.NET Razor Page Select List Loses Data after Server-Side Validation Failed

I am using .NET Identity for authentication and authorization. For my registration page, I added two selectListItem properties in the InputModel class for dropdown lists. The problem is, when the server-side validation failed, the dropdown lists…