asp.net-identity

Disable Two-Factor Authentication in ASP.NET Identity 2.0.0-beta1

ぃ、小莉子 提交于 2019-12-13 13:13:31
问题 I'm using the latest 2.0.0-beta1 release of ASP.NET Identity and I don't want to utilise the new two-factor authentication support. In fact I want to remove the additional database columns EmailConfirmed, PhoneNumber, PhoneNumberConfirmed and TwoFactorEnabled but I can't see where I need to override the Identity classes to disable this functionality. 回答1: You need to implement your own UserStore to remove the functionality. The generic constraint on Identity.EntityFramework.UserStore is that

Moving Asp.Net Mvc default application dbcontext class to another folder [closed]

泪湿孤枕 提交于 2019-12-13 09:53:55
问题 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 2 years ago . I am building an asp MVC website. I am using authentication for my site so I took the default authentication method from the default template. Im now fully confused between the identity application dbcontext class and my custom dbcontext class for my application. I have many

When claims are available

对着背影说爱祢 提交于 2019-12-13 08:52:13
问题 I add a claim in GenerateUserIdentityAsync method: public class ApplicationUser : IdentityUser { public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager) { var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); userIdentity.AddClaim(new Claim(ClaimsStaticStrings.Inactivity, company.Inactivity.ToString())); return userIdentity; } } Then I try to get it in Account/Login method: [HttpPost] [AllowAnonymous

save new data to user table using asp identity

佐手、 提交于 2019-12-13 07:57:57
问题 I am trying to add a piece of data to the Asp identity table which stores user details ( AspNetUsers ). I have code to create a new user but not how to add or change things in a table. Could someone link me a resource or show me an example of how to do this? For example if I created users where age was null and had a form that asked a user to input an age and wanted to add that to the users information without having to create a new user. I have all the code to collect the variable. I have

Logout functionality not working with ASP.NET identity

非 Y 不嫁゛ 提交于 2019-12-13 07:42:22
问题 I am trying to sign out of the application, but the authentication cookie is not getting deleted. Below is my implementation //Log in action var identity = new ClaimsIdentity(new[] { new Claim(ClaimTypes.Name, loginModel.UserName), }, DefaultAuthenticationTypes.ApplicationCookie, ClaimTypes.Name, ClaimTypes.Role); Authentication.SignIn(new AuthenticationProperties { IsPersistent = loginModel.RememberMe }, identity); //logout action IAuthenticationManager Authentication { get { return

How to use ASP.NET Identity for Temporary Administrator Access [Coming-Soon-Page]

夙愿已清 提交于 2019-12-13 07:05:34
问题 I am creating a new website, and it's already online, but I want to block access to everyone! And just let my client use it to check the development process everyday, so he don't need to download everything and set up on his computer.. I was wondering about using ASP Identity, is there any simple "hack" to achieve this? Or my only way is the following: Add the Register Page to the WebSite Register an account with Administrator role Delete Register Page of the WebSite Use always the same

ASP.NET Core identity shared across browser

空扰寡人 提交于 2019-12-13 06:29:31
问题 When I'm deploying an ASP.NET Core web application to Azure, I have an issue with the session : they are shared across browsers. Explanation : I'm going to my deployed site, I log in with my email/password then I'm logged in. If I open the website in an other browser on the same machine or on an other machine, I'm now connected with the credentials I used in the first browser. I deployed the default template from Visual Studio without any changes. Is there something to do to resolve this

ASP.net Identity Custom Tables using OwinContext

柔情痞子 提交于 2019-12-13 05:09:59
问题 I'm trying to implement custom tables to store users/roles etc. in a SQL server DB using Entity framework 6. I've create a base DbContext that derives from IdentityDbContext public class MainContext : IdentityDbContext<ApplicationUser> { public MainContext() : base("name=Main") { } public static MainContext Create() { return new MainContext(); } } I also have a custom user class that inherits IdentityUser public class ServiceUser : IdentityUser{ } In the ConfigureAuth the defualt code was:

ASP.NET Identity Custom with Group-based Roles

别等时光非礼了梦想. 提交于 2019-12-13 05:03:07
问题 Perhaps I've misunderstood the concept of Roles in ASP.NET Identity and the database model, but I'm struggling to wrap my head around how to implement the following scenario: With ASP.NET Identity, it seems a User has permissions globally based on a Role, as opposed to permissions on a more granular level. I'm trying to implement a DB Schema in EF6 with Code-First where a User can be a member of several Groups. Instead of having a global Role however, I want the User to have one role in one

How to delete user in web api?

青春壹個敷衍的年華 提交于 2019-12-13 04:43:47
问题 I have created a web api with Individual User authentication. After user get registered his information is stored in 2 tables, his general information is stored in "AspNetUsers" table and his role is stored in "AspNetUserRoles" table. Now the problem is when I am trying to delete any user from the list, its not working.Here is the delete action: [ResponseType(typeof(AspNetUser))] [ActionName("EmployeeInfo")] [DeflateCompression] public IHttpActionResult DeleteEmployeeInformation(string Id) {