asp.net-identity

How to hold the cookies claims updated with MCV5/OWIN

一个人想着一个人 提交于 2019-12-21 04:25:15
问题 We’re working on an OWIN MVC5 project. We use an own implementation of IUserStore<T> to integrate the user-management which is part of our companies framework. So far this works fine. We want to provide role membership and other security configuration through claims. I have seen (and quickly tested) the ways of either implementing IUserClaimStore<T> or of attaching a ClaimsIdentityFactory to the UserManager. In both scenarios, I see the issue that the claims are stored in the user’s cookie

Getting a list of users with their assigned role in Identity 2

寵の児 提交于 2019-12-21 04:24:34
问题 I am stuck trying to get this output Id | Name | Role ---------------------------- 1 | John | Administrator ---------------------------- 2 | Mary | Manager ---------------------------- 3 | Sage | Editor ---------------------------- 4 | Hank | Manager I can make it work in LINQPad, but somehow I am unable to translate it to ASP.NET MVC. from u in Users from ur in u.Roles join r in Roles on ur.RoleId equals r.Id select new { Id = u.Id, Name = u.Name, Role = r.Name, } How do I LINQ that in ASP

.NET Core External Authentication without ASP.NET Identity

空扰寡人 提交于 2019-12-21 04:11:05
问题 I use my own JWT token authentication and not the asp.net identity that comes free with the default template. I've looked everywhere for some documentation/guidence on how to implement exernal authentication without asp.net identity but all articles out there is for the asp.net identity authentication. I've managed to redirect the user to the google log in page, (using ChallengeResult), but when the provider redirects back the app fails me. I've removed: app.UseAuthentication(); in Startup.cs

How to invalidate .AspNet.ApplicationCookie after Adding user to Role using Asp.Net Identity 2?

佐手、 提交于 2019-12-21 04:04:15
问题 I have 2 questions related to that: 1) I need to invalidate.AspNet.ApplicationCookie after Adding / Removing some remote user to Role using Asp.Net Identity 2. I Tried to use UpdateSecurityStamp, but since no password or username is changed, SecurityStamp remains same. When I use ApplicationRoleManger I can see that User roles are updated but in User.Identity Claims they stay unchanged. 2) How does .AspNet.ApplicationCookie Validation work and how can I access it? I was trying to use this

How to add Azure AD Authentication to Existing ASP.NET MVC Application?

三世轮回 提交于 2019-12-21 03:42:39
问题 I have an existing ASP.NET MVC application using Visual Studio 2013. I followed this walk-through but it only concerns itself with a new greenfield project while selecting Change Authentication in project template: Developing ASP.NET Apps with Windows Azure Active Directory I am not interested in using OWIN and OpenID Connect Katana modules as these components have lots of issues so I am waiting for that technology to mature and render out all the current problems. I aim is understand how to

How do we implement permissions in ASP.NET identity?

回眸只為那壹抹淺笑 提交于 2019-12-21 02:26:13
问题 We understand how to implement authentication and authorization in ASP.NET identity with the WebApi. For instance, we can log a user in and then retrieve both his secure token and role. We now want to add permissions. For instance, user steve may be in the admin role. Now we want to assign read, edit, and delete permissions to the admin role. How do we do that in ASP.NET Identity? Is there existing permissions infrastructure in ASP.NET Identity? 回答1: I extended ASP.NET Identity to allow for

Ninject and ASP.NET Identity 2.0

此生再无相见时 提交于 2019-12-20 21:55:34
问题 I just upgraded the ASP.NET Identity Entity Framework package from 1.0 to 2.0 and one of the Ninject bindings is now broken: kernel.Bind<IUserStore<User>>().To<UserStore<User>>(); kernel.Bind<UserManager<User>>().ToSelf(); kernel.Bind<IRoleStore<IdentityRole>>().To<RoleStore<IdentityRole>>(); kernel.Bind<RoleManager<IdentityRole>>().ToSelf(); The second last one is giving this error on compile: The type 'Microsoft.AspNet.Identity.EntityFramework.RoleStore' cannot be used as type parameter

Ninject and ASP.NET Identity 2.0

烈酒焚心 提交于 2019-12-20 21:55:10
问题 I just upgraded the ASP.NET Identity Entity Framework package from 1.0 to 2.0 and one of the Ninject bindings is now broken: kernel.Bind<IUserStore<User>>().To<UserStore<User>>(); kernel.Bind<UserManager<User>>().ToSelf(); kernel.Bind<IRoleStore<IdentityRole>>().To<RoleStore<IdentityRole>>(); kernel.Bind<RoleManager<IdentityRole>>().ToSelf(); The second last one is giving this error on compile: The type 'Microsoft.AspNet.Identity.EntityFramework.RoleStore' cannot be used as type parameter

The AspNetUserLogins table Identity [closed]

那年仲夏 提交于 2019-12-20 16:23:33
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . What is the AspNetUserLogins for? Is It to store the logins from the user? How can I then update this table with that data? 回答1: What is the AspNetUserLogins for? In Asp.net Identity, the Identity system uses the AspNetUserLogins table to hold information about 3rd party/external

Seeding Identity 2.0 database

此生再无相见时 提交于 2019-12-20 12:33:26
问题 I have an ASP.NET MVC 5 project (razor engine) which has Identity 2.0 with Individual User Accounts. I am using Visual Studio Professional 2013 I have not found any clear example (why doesn't it come out of the box?) of HOW I can seed the Identity 2.0 database and all examples I see are half backed because they don't say WHERE exactly you have to implement that. I used enable-migrations which created a Migrations folder with a Configuration.cs file. It has a Seed method override but when I