asp.net-identity

ASP.NET Identity Session Timeout

岁酱吖の 提交于 2019-12-18 03:47:09
问题 I use ASP.NET Identity .. I want to set session timeout to unlimited or max value. I've tried something but it doesn't effect. Note: I use shared hosting. Thank you. //web.config <system.web> <customErrors mode="Off" /> <httpRuntime targetFramework="4.5" /> <authentication mode="Forms" /> <sessionState timeout="500000" /> </system.web> //asp.identiyt config public void ConfigureAuth(IAppBuilder app) { app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType =

ASP.NET Identity Session Timeout

别等时光非礼了梦想. 提交于 2019-12-18 03:46:26
问题 I use ASP.NET Identity .. I want to set session timeout to unlimited or max value. I've tried something but it doesn't effect. Note: I use shared hosting. Thank you. //web.config <system.web> <customErrors mode="Off" /> <httpRuntime targetFramework="4.5" /> <authentication mode="Forms" /> <sessionState timeout="500000" /> </system.web> //asp.identiyt config public void ConfigureAuth(IAppBuilder app) { app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType =

The entity type 'IdentityUserLogin<string>' requires a primary key to be defined [duplicate]

僤鯓⒐⒋嵵緔 提交于 2019-12-18 03:04:23
问题 This question already has an answer here : The entity type 'Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin<string>' requires a key to be defined (1 answer) Closed 12 months ago . i am using dotnet core 1.1 on linux, and i am having issues when i want to split up the identityContext from my regular dbContext, whenever i run the following line in my startup.cs --> configure: //... some other services using (var serviceScope = app.ApplicationServices.GetRequiredService

How to add MVC 5 authentication to Unity IoC?

╄→гoц情女王★ 提交于 2019-12-17 23:26:55
问题 I'm currently working on implementing the new ASP.NET MVC 5 out-of-the box authentication into my application. However when using Unity as my IoC, I cannot use any portion of the AccountController because I'm given the error: The type IUserStore`1 does not have an accessible constructor. This is my given unity setup which is called in the global.asax public class DependencyConfig { public static void Initialise() { var container = BuildUnityContainer(); DependencyResolver.SetResolver(new

How to create ASP.Net Identity tables inside existing database?

匆匆过客 提交于 2019-12-17 22:47:01
问题 I am building my first MVC 5 / Entity Framework application. I used the database first method to pull in my data from an existing SQL server. The existing SQL database receives it's data from a separate web forms .net application. Moving forward, the new MVC application and the existing web forms application will share the database. I am using Identity to create user accounts within the MVC application. So at this point, I have 2 data connections in my MVC application. One for the user

Get current user id in ASP.NET Identity 2.0

ⅰ亾dé卋堺 提交于 2019-12-17 22:33:13
问题 I just switched over to using the new 2.0 version of the Identity Framework. In 1.0 I could get a user object by using manager.FindByIdAsync(User.Identity.GetUserId()) . The GetUserId() method does not seem to exists in 2.0. Now all I can figure out is to use manager.FindByEmailAsync(User.Identity.Name) which references the username field in the users table. In my application this is set to the same as the email field. I can see this causing issues down the road when someone needs to update

Token based implementation in webapi to secure endpoints

你。 提交于 2019-12-17 22:28:13
问题 I am having a web application with web service and client will register their application using my web application. Now client will have application of type SPA or mobile apps and they will consume my webservices from their apps. So I would be implementing token based mechanism for securing access to my endpoints. 1) But here I am confused that shall I use any framework to generate access token or I can use any library which will generate any random string which i will send in response.for

Prevent login when EmailConfirmed is false

北城余情 提交于 2019-12-17 22:13:47
问题 The newest ASP.NET identity bits (2.0 beta) include the foundation for confirming user email addresses. The NuGet package "Microsoft Asp.Net Identity Samples" contains a sample showing this flow. But in that sample, even when EmailConfirmed = false , there is no different behavior in the user experience. How can I prevent users from being able to login when their email address is not yet confirmed? I understand that I can have the users log in regardless and then perform the check on the

ASP.NET Identity login

岁酱吖の 提交于 2019-12-17 21:57:13
问题 I have a website in MVC 5 using ASP.NET Identity to login a user. Everything works great. Now my partner needs to login a registered user in his WinForms app. Does anyone know the password hashing algorythm used by Identity or how can I authenticate the user in the WinForms app? Any tips would be apreciated. Best regards. 回答1: If you are using Microsoft.AspNet.Identity.EntityFramework from the MVC app and the WinForm app has access to the same database, then you should configure it to use the

Why does IsInRole always return false?

為{幸葍}努か 提交于 2019-12-17 20:43:19
问题 I am building an MVC5 application with ASP.NET Identity 2.0 and EF 6.1.1. This is part of my current Login method: [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public async Task<ActionResult> Login(LoginViewModel model, string returnUrl) { if (!ModelState.IsValid) return View(model); var result = await SignInManager.PasswordSignInAsync(model.UserName, model.Password, model.RememberMe, shouldLockout: true); switch (result) { case SignInStatus.Success: { var user = await UserManager