asp.net-identity

How to resolve issues with CRUD Operations in an ASP.NET MVC Kendo UI Grid

末鹿安然 提交于 2019-12-08 03:31:03
问题 I've been trying to get the Kendo UI grid to act as a user management tool in a system I'm currently writing. I've bound data to the grid, using ASP.NET Identity to get the user information, but I can't seem to get the update or delete actions to fire on the grid. I've set the grid up as below: @(Html.Kendo().Grid<MyProject.Models.UserInfo>() .Name("userGrid") .Columns(columns => { columns.Bound(p => p.UserName); columns.Bound(p => p.FirstName); columns.Bound(p => p.LastName); columns.Bound(p

Azure Mobile Apps offline WEBSITE_AUTH_SIGNING_KEY

给你一囗甜甜゛ 提交于 2019-12-08 02:52:13
问题 When trying the Azure Mobile Apps offline (in Visual Studio and local IIS with SSL), one has to supply an alternative to Azure's WEBSITE_AUTH_SIGNING_KEY as the SigningKey for the JWT tokens. How can you generate a dev SigningKey? 回答1: In order to test authenticated endpoints locally you need to use the same signing key that was used to generate the auth token (JWT). If you are logging in against your cloud site, this means that locally you must validate the token using the same signing key.

Compiler Errors after updating Microsoft.Aspnet.Identity in MVC5

笑着哭i 提交于 2019-12-08 01:45:15
问题 Using the Vs2013 preview, i created a c# webapp selecting MVC and WebAPI from the dialog. It compiled ok. If i update the references from the nuget package manager to the beta2 versions (include Prerelease), it then fails to compile. I get 21 errors, located in the AccountController.cs and the IdentityConfig.cs. I tried updateing to the latest nightly libraries which gave the same errors. Appreciate preview code is just that so start again from the template. Was wondering if anyone knew which

ASP.NET MVC4 entity validation errors: User name already taken

橙三吉。 提交于 2019-12-07 23:56:06
问题 I am new to ASP.NET MVC4, getting a validation error on the code below. My app is using Identity and a Database. I have some tables populated with some testing data. A call to dc.SaveChanges() returns Validation errors. I created the following classes: Faculty deriving from class Person deriving from class IdentityUser . I created a role named Faculty , then created a Faculty object named mark and added it the Faculty role. As mark logs in and the Database starts initializing, I get the error

Combine my ApplicationsDbContext with IdentityDbContext no key defined using MVC 5

心已入冬 提交于 2019-12-07 22:53:57
问题 I was combining my existing DBContext with the new IdentityDbContext in MVC 5. I managed to combine the two contexts but when I ran my application and the model was being created I was presented with the following error message: Context.IdentityUserLogin: : EntityType 'IdentityUserLogin' has no key defined. Define the key for this EntityType. Context.IdentityUserRole: : EntityType 'IdentityUserRole' has no key defined. Define the key for this EntityType. 回答1: I worked out how to fix it after

Need understanding on how to get/display User Role

99封情书 提交于 2019-12-07 20:50:39
问题 I’m in the process of learning MVC with Identity 2 and I’m at the point of taking a sample project and tweaking it to fit a site that I’m trying to convert from WebForms with ASP.Net Membership provider. What I’m having issues with at the moment is getting my head wrapped around how I get a value from another table to populate a property in a class. I have a class called AppUser.cs and it inherits from IdentityUser. That is basically mapped to a table named “AspNetUsers” using EntityFramework

Refresh user name in navbar after username has changed (Using Asp.Net, MVC and C#)

时光总嘲笑我的痴心妄想 提交于 2019-12-07 20:35:30
I am trying to update the user name in the navbar (using ASP.NET, MVC, C#) after a user has changed his or here user name when signed in. So the user name is shown, but when it's changed the old user name is still being displayed in the navbar until the user loges out and in again. Dose any one know how to display the new user name in the navbar in a nice way? This is a short version of how the navbar looks like: <nav class="navbar navbar-default navbar-fixed-top"> @if (Request.IsAuthenticated) { @Html.AntiForgeryToken() <a href='@Url.Action("Index", "Manage")'>@User.Identity.GetUserName()</a>

How to delete user with UserManager in mvc5

不想你离开。 提交于 2019-12-07 19:51:22
问题 I'm using mvc5, and everything about user account management I do with UserManager. It works good with roles, claims, etc. But I didn't find how to delete user with UserManager. Is there a way to delete user with UserManager? I can create Database context with dbset and then delete it from this context, but I don't want create dbcontext, userclass, etc. for one delete method. 回答1: Delete was not supported in UserManager in 1.0, but its supported in the upcoming 2.0 release, and in the current

ASP.NET Identity - Confusion about [Authorize] And RoleManager

懵懂的女人 提交于 2019-12-07 19:30:12
问题 I have been following this post on creating a custom "storage provider" for the new ASP.NET Identity system, and so far it has proven very informative; Creating a custom MySQL Identity Provider I am not using MySQL, I am using RavenDB - and yes, I have already looked at the available RavenDB Identity Providers out there - that isn't really my issue. My issue comes with the IUserRoleStore<IdentityUser> and then the IdentityRole , as well as RoleStore . I see them get created - I even see how

How to unauthenticate current user ASP.net mvc Identity

一笑奈何 提交于 2019-12-07 18:05:18
问题 When a user goes to my site they get the login page. Once they successfully login they can logoff and a different user can login. However, if the user clicks the back button while logged in it goes to the login page. At this point a new user can no longer login. I receive an anti-forgery token error. I have tried to logoff any user that goes to the login page. I have tried different ways to logoff. I even tried to Session.Abandon(); Account controller: // GET: /Account/Login [AllowAnonymous]