asp.net-identity-2

Why can't users authenticate after deploying locally the ASP.NET 4.6 application to the IIS 10 server?

核能气质少年 提交于 2020-01-13 20:28:31
问题 In my ASP.NET Web Forms application I am using ASP.NET Identity 2.2 for the membership system. The Development stage works as expected. Users get authenticated and have access to different areas of the website according to their roles. After the deployment to the IIS 10 local server the authentication is overturned. The login is successful and, yet, the user does not authenticate. The Login page loads once again empty and fresh. I know that the login is successful through some test I've made

ASP.NET Identity in Microservice Architecture

浪尽此生 提交于 2020-01-09 03:21:45
问题 I'm attempting to implement a web app using a microservice architecture by breaking up major components into separate web servers. I'm implementing an authentication server using ASP.NET Identity (email/username logins only, no Facebook, etc) and a "main" application server. My current challenge is figuring out how the application server will recognize if a user has logged via the authentication server. Since the authentication server generates tokens which it users to verify users's

Cannot access User.Identity.GetUserId() inside Login action of AccountController in MVC 5

旧街凉风 提交于 2020-01-07 02:26:04
问题 Current Environment Visual Studio 2015, MVC5, Asp.net Identity 2.0, Entity Framework 6.0 Problem I was trying to get User.Identity.GetUserId() after user is just authenticated, but got "Object reference not set to an instance of an object" in the browser. Expectation If it is possible, I want to User.Identity.GetUserID() at the same position. And I wander where the start point is that I can access User.Identity.GetUserId() in the project. Code // // POST: /Account/Login [HttpPost]

MVC 5 Web API Login without Bearer Token

淺唱寂寞╮ 提交于 2020-01-07 02:24:27
问题 Long story short. I have a login form in the header on every single page, when I log in successfully it works fine but when the user is incorrect for example it redirects to the default login page (a view that was originally created with MVC project) with the model errors. I don't want to do that, I want to show errors next to the login form without redirecting. So I decided to implement a login via WEB API - i.e. it does $.ajax jQuery request to the Login API Controller, tries to log user in

Email Confirmation Error Invalid Token AspNet Identity

ぃ、小莉子 提交于 2020-01-06 02:07:44
问题 I have two Web applications, WCF and MVC which share same database. I am using Aspnet Identity 2.0 While registering new user, it creates confirmation token and sends email to the user. Creating token, sending email is mostly done in WCF, verification is done in MVC application. var code = UserManager.GenerateEmailConfirmationToken(user.Id); string.Format("{0}/Account/ConfirmEmail?userId={1}&code={2}", WebsiteUrl, HttpUtility.UrlEncode(user.Id), HttpUtility.UrlEncode(codeId)); I am using same

Can't extend IdentityUserRole.cs to add new composite key to dbo.AspNetUserRoles table ASP.NET Identity 2.1

爷,独闯天下 提交于 2020-01-06 01:32:07
问题 I am trying to build Membership system using ASP.NET Identity 2.1, ASP.NET Web API 2.2 and i need to extend IdentityUserRole to add another PK to its table like that: public class ApplicationUserRoles : IdentityUserRole { public Guid ProjectId { get; set; } public Project Project { get; set; } } public class Project { public Project() { ProjectId = new Guid(); } public string ProjectName { get; set; } [Key] public Guid ProjectId { get; set; } } And in the DBcontext class I added : protected

Instantiate Identity ApplicationUserManager in Class Library

房东的猫 提交于 2020-01-05 01:44:32
问题 One of the things I do not like about Identity is that the UserManagers have to be instantiated in the controller that you wish to get user information for. In my project, I moved all the business logic into a DAL class library and wanted the Identity to be there as well. I have already moved all the identity classes into the DAL class library (ApplicationRole, ApplicationUser, ApplicationRoleManager, ApplicationSignInManager, ApplicationUserManager, EmailSerivce, SmsService) My DataContext

Allowing both email and username for authentication

浪尽此生 提交于 2020-01-04 09:15:23
问题 I'm creating two projects (MVC 5 and Web API) using ASP.Net Identity 2.1 and I couldn't find how to use both email and username for authentication (an area called Admin must use a username and the common area must use email addresses for authentication). The problem is that there is only one method for authentication and it does not allow you to specify if you will compare with the email address or the username. SignInHelper.PasswordSignIn What should I do to achieve this? 回答1: SignInManager

Allowing both email and username for authentication

痞子三分冷 提交于 2020-01-04 09:15:08
问题 I'm creating two projects (MVC 5 and Web API) using ASP.Net Identity 2.1 and I couldn't find how to use both email and username for authentication (an area called Admin must use a username and the common area must use email addresses for authentication). The problem is that there is only one method for authentication and it does not allow you to specify if you will compare with the email address or the username. SignInHelper.PasswordSignIn What should I do to achieve this? 回答1: SignInManager

SignalR Authorization using Web API Token

与世无争的帅哥 提交于 2020-01-02 10:28:06
问题 I am attempting to authorize SignalR requests exactly using the sample project here AngularJS Authentication based on this project AngularJS Authentication using web tokens. The problem I am having is, to use SignalR authorization, I had to override the SignalR AuthorizeAttribute class as below: public class QueryStringBearerAuthorizeAttribute : AuthorizeAttribute { public override bool AuthorizeHubConnection(HubDescriptor hubDescriptor, IRequest request) { var token = request.QueryString.Get