Questions tagged [asp.net-identity-2]

The second release of the ASP.NET Identity system which was designed to replace the previous ASP.NET Membership and Simple Membership systems. Use this tag if your question deals specifically to ASP.NET Identity 2 features. The [asp.net-identity] tag should be used if your question is not specific to ASP.NET Identity 2.

Resources:

Announcing RTM of ASP.NET Identity 2.0.0

1063 questions
0
votes
1 answer

.Net MVC 5 nested isinrole

Is it possible with ASP.NET C# MVC 5 (.NET 4.5.1) using Identity 2.0 to have nested IsInRole(). I am doing this because I want to hide a menu element to only people in the Admin role and on top of that, I want to hide a link to only people in the…
Shawn Gavett
  • 458
  • 1
  • 5
  • 12
0
votes
1 answer

Asp.Net DbContext ... Why is it called so often in my app? ... Confusion

To learn Asp.Net Identity I have been using the Microsoft supplied Identity Samples template which can be downloaded via NuGet. https://www.nuget.org/packages/Microsoft.AspNet.Identity.Samples/2.1.0-alpha1 OR in the package manager console…
0
votes
0 answers

Why is this Entity Framework code not creating a join table?

I have an ASP.NET identity user class that I wish to extend with a many-to-many relationship: public class MyUser : IdentityUser { public virtual ICollection Groups { get; set; } public MyUser() { Groups = new…
0
votes
1 answer

Always get "Authorization has been denied for this request." using Bearer tokens in Identity 2?

Using postman I can request a token, here it is: { "access_token":…
BBauer42
  • 3,549
  • 10
  • 44
  • 81
0
votes
1 answer

Decoupling Asp.net Identity 2 web api from project?

I have created an Asp.net Web API 2 project following tutorials like this one. I've extended the identity models to use int keys for my users like so. Now I am stuck on how to completely decouple this "Auth API" from my core project. I'm aware of…
0
votes
0 answers

Expand User.Identity properties

I have a site with frontend and admin panel. Both have login page and user should be able to login on both frontent and admin panel with different user. By default User.Identity.IsAuthenticated is used to check if user is currently logged in, I want…
tickwave
  • 3,335
  • 6
  • 41
  • 82
0
votes
1 answer

Customizing AspNet Identity Authentication DB objects

I am using Microsoft.AspNet.Identity.EntityFramework.IdentityDbContext class for authentication of my users. This is a new concept to me and it confuses me a lot. By default it creates 5 tables with default names: AspNetRoles, AspNetUserRoles,…
0
votes
0 answers

Integrate asp.net authentication with multiple clients' Active Directories

I've done quite a bit of research on Asp.net Identity 2.0 and know that it supports Active Directory authentication but can't figure out how to integrate active directory integration in my particular scenario. The basic premise is that I want the…
tunafish24
  • 2,288
  • 6
  • 28
  • 47
0
votes
0 answers

Violation of PRIMARY KEY constraint 'PK_dbo.AspNetUserRoles' is thrown in SignInManager.PasswordSignIn

Asp.net Identity 2 SignInManager.PasswordSignIn() is throwing an exception whenever a newly registered account tries to login in, with the following message. Violation of PRIMARY KEY constraint 'PK_dbo.AspNetUserRoles'. Cannot insert duplicate…
Cizaphil
  • 490
  • 1
  • 6
  • 23
0
votes
0 answers

User.Identity.GetUserId() null after login again

i have a problem: when i login User.Identity.GetUserId() return correct value of ID, but when i click logout and then login again with another user User.Identity.GetUserId() return null: my code: protected void LogIn(object sender, EventArgs e) …
Fabio
  • 7
  • 1
  • 4
0
votes
1 answer

Microsoft.AspNet.Identity.Owin.OwinContextExtensions doesn't seem to work

I am creating a custom asp.net.identity provider in a separate assembly in order to use it from two different web api 2 projects. I took the default vs2013 template for a web api project as a guide and so far I have implement the required…
ChD Computers
  • 3,135
  • 3
  • 23
  • 33
0
votes
0 answers

LogIn in Asp.Net Identity project

I'm doing an Web Application based on Asp.Net, and the login system based on Identity Framework. The problem that I'm getting is a bit strange. I run the application that takes me to the login page, I login (and redirected to the homepage) then if I…
Andre Roque
  • 503
  • 1
  • 9
  • 31
0
votes
1 answer

C# Identity UserManager CreateAsync then FindByEmailAsync returns User with Id=0

Identity with Dapper. My user in my Identity is of type IUser< int > When a user Registers, I create a user in my AccountController: Register POST: if (ModelState.IsValid) { user = new MySiteUserRecord { UserName = model.UserName, …
0
votes
1 answer

Identity 2.0 After Login go to Infinite Loop asp.net mvc 5

I have added email confirmation process like below: var code = await _users.GenerateEmailConfirmationTokenAsync(model.UserName); var callbackUrl = Url.Action( "ConfirmEmail", "Account", new { username =…
0
votes
1 answer

Authorization Error, 'RoleEntity is not part of the model for the current context'

I currently upgrade my code from ASP NET MVC 4 to 5. I had a problem after add OWIN security, below is the code that I use. [Authorize(Roles="Admin")] public async Task test() { var role = ""; using ( var…