forms-authentication

Redirect after login results in 404 error if a user submits a form to a POST-only action and their authentication has timed out

杀马特。学长 韩版系。学妹 提交于 2019-12-12 08:08:30
问题 I have an MVC app using Forms Authentication, and I'm getting 404 errors. What's happening is the user happens to be submitting a form to a POST-only action when their authentication has timed out, and they are redirected to the login page. After login they are redirected back to the original URL using GET, which will result in a 404 error as the action is POST-only. I have two questions: My idea to get around this is to somehow detect whether the action being redirected to is a POST-only

ASP.NET site auto-login during development

北慕城南 提交于 2019-12-12 08:00:47
问题 While developing an ASP.NET site, is the a way to setup automatic login? For example, each time I build the site and run it, I have to login again. I don't want to disable security entirely, but I would like to automate the process of logging in while I'm working on the site. 回答1: Just keep your browser open and Ctrl+F5 after you modify and/or recompile in Visual Studio. This will keep the authentication cookie. Another possibility is to setup an automatic login page in which you would test

RedirectFromLoginPage() is not updating User.Identity.Name

别来无恙 提交于 2019-12-12 06:37:00
问题 I use FormsAuthentication.RedirectFromLoginPage(userName.Trim(), false); to set the User.Identity.Name field that I reference later. When I execute this line, the User.Identity object does not update at all; it contains whatever it was previously set to. All the documentation I see online says this should update my User.Identity object with the correct name, but I don't see that happening. I have the web config set up properly with the following lines: <authentication mode="Forms"> <forms

Shared Forms Authentication not working between .NET 3.5 and .NET 4.0 applications

孤人 提交于 2019-12-12 05:20:38
问题 I have two web applications, one running under .Net 3.5, the other has been upgraded to .Net 4.0. Prior to the upgrade, shared authentication was setup and working correctly between the two applications as indicated in the MSDN article: http://msdn.microsoft.com/en-us/library/eb0zx8fc.aspx The 3.5 Application is running under the Classic .NET AppPool (v2.0, Classic Pipeline). The 4.0 application is running under the ASP .NET v4.0 AppPool (v4.0, Integrated Pipeline). 回答1: The problem turned

SSO FormsAuthentication - 2 Applications - 1 x WebForms and 1 x MVC

六月ゝ 毕业季﹏ 提交于 2019-12-12 03:58:19
问题 I have read many posts and while I have gleaned all the information I need I cannot get this to work. So I am hopeful someone can point me in the right direction. Or if you have a working dummy project(s) even better. All the examples I have see do not specifically deal with my requirement 2. I have an existing WebForms (W1) application that uses FormsAuthentication. As part of migrating this to MVC we want to create an MVC (M1) application "alongside" it and implement new functionality there

Forms Authentication Not Working After Publish

拟墨画扇 提交于 2019-12-12 03:05:44
问题 I have been working on a website project which restricts access to a certain folder to annonymous users and allows access to the folder to those who are logged in. This has been working perfectly on my development machine. However since publishing the website and deploying to a web server (Windows Server 2008, IIS7) the forms authentication appears not to be working. Anonymous users are able to access the "restricted" folder. I have compared the webconfig on both the development machine and

ASPNET MVC3: Can I use my user/roles tables to handle user authentication?

大憨熊 提交于 2019-12-12 02:43:48
问题 I'm building an ASPNET MVC3 app; I have built, on the SQLServer DB, my users, roles and user_roles tables andI would like to use them instead of the aspnet_* tables built by using aspnet_regsql.exe. Do you know if is this possible and, if so, in which way I can authenticate my users towards my tables? 回答1: You just need to implement your own Membership and Role providers. see How do I create a custom membership provider for ASP.NET MVC 2? 回答2: Yes, you will need to build a custom memberShip

Set Membership Provider to use a specific Provider

梦想的初衷 提交于 2019-12-12 01:35:26
问题 I'm using the out of the box Asp.Net Membership functionality to handle my user management and role management. My application consists of a single database for each client and each database has its own Membership provider and role provider. However, there are some users who work for more than one of the clients and I want to be use a single login and let them choose which client to view. I have everything setup to facilitate this "client switching" by using an intermediate database that

SharePoint Groups\Roles using FBA

烈酒焚心 提交于 2019-12-12 01:34:42
问题 I'm running an FBA web app, having 2 Site collections. Currently I have a SharePoint group in one site collection, and I would like to assign permission to that group in the other site collection. Since SharePoint groups are site scoped, I thought using FBA roles.. Any words on how to do this, or if this it the recommended way? Thanks. 回答1: I am a fan of AD groups or FBA roles inside of SharePoint groups regardless of the number of site collections or authentication method. It is just cleaner