forms-authentication

forms timeout issue in asp.net mvc

余生颓废 提交于 2020-01-03 14:05:01
问题 how to turn off forms authentication in asp.net mvc.I have register,logon and forgotpassword page designed to enter into the webapplication. Initially i I currently host my asp.net mvc web application as single codebase and multipledatabase format.I face forms getting expired at some period of time and logon.aspx page appears in the middle on the homepage. I figured out this is because of the following code: webconfig: <authentication mode="Forms"><forms timeout="180000" slidingExpiration=

Want Forms and Windows authentication to work in combined mode

匆匆过客 提交于 2020-01-03 05:22:09
问题 I am working on application which a´has two types of users external user and internal user(domain user). Now for internal user should directly take users to landing page without asking for username and password. And for external user which are public it should display a form asking for username and password. So I am confused to proceed with such scenario. 回答1: I've done it a couple of times. I haven't used this, but there is a project called OWIN-MixedAuth that might help. Even if that doesn

MVC3 Session timeout after 10 seconds

[亡魂溺海] 提交于 2020-01-03 03:07:07
问题 Need some help with a Session timeout problem in an ASP.Net web app. Essentially the session expires about 10-15 seconds after login. Side Note: I use a custom combo of FormsAuthentication and basic security My Session.IsNewSession gets set to true after 3-4 good postbacks after login. My Web.Config has the following... <sessionState mode="InProc" timeout="130" regenerateExpiredSessionId="true" stateNetworkTimeout="120" compressionEnabled="true" cookieless="UseCookies" /> <authentication mode

ASP.NET Forms Authentication - When to use?

我是研究僧i 提交于 2020-01-02 10:03:56
问题 I am not able to decide whether I should go for Forms Authentication ? Forms authentication is often used for personalization, where content is customized for a known user. I do not have such requirement. I have usernames and passwords in the DB and need to authenticate the users against the DB ? What is the best recommended practice to achieve the same in ASP.NET 2.0 ? 回答1: TL;DR: The FormsAuthenication class has nothing to do with passwords. You need to use it to keep users logged in to

How to Call .NET AuthenticationService from json client without ASP.NET

对着背影说爱祢 提交于 2020-01-02 09:29:10
问题 I have a WCF 4 service which is in a Secure subfolder, accessible after the client has authenticated using Forms authentication using the .NET AuthenticationService. This WCF service is for a mobile app client which communicates via json but is not an ASP.NET app. I have successfully configured the service to use json and the AuthenticationService has the standard configuration as documented in many places e.g. http://msdn.microsoft.com/en-us/library/bb398990.aspx The docmentation for the

Using Forms Authentication/Authorization with Rewritten URLs

随声附和 提交于 2020-01-02 07:12:18
问题 I'm doing a quick sandbox test with some Rewritten URLs (example taken from Scott Guthrie's blog) and Forms Authentication / Authorization. I've a very simple setup. ~/View/(\d{1,6}) => ~/Public/View.aspx?ContentID=$1 AND ~/Buy/(\d{1,6}) => ~/Private/Purchase.aspx?ContentID=$1 I've confirmed the URL Rewriting is working by browsing to each of the following seperately http://localhost/urltest/Public/View.aspx?contentID=123456 http://localhost/urltest/View/123456 http://localhost/urltest

Simple Authorization in MVC3 with Forms Authentication

对着背影说爱祢 提交于 2020-01-02 06:29:13
问题 I'm trying to do what should be a simple thing in MVC3. I've got an application that uses forms authentication to authenticate users with a 3rd party SSO. The SSO, on successful login, posts back to a specific controller action on my application. I then call FormsAuthentication.SetAuthCookie(user,false); . I'm trying to implement some level of authorization. Simply, a user can exist in a number of different roles, e.g. Admin and Developer . Some controller actions should only be available to

Forms Authentication fails to recognize as logged in under IE when underscore in hostname

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-02 04:05:24
问题 In my asp.net webforms application I am using plain and simple forms authentication hooked up into my database (with the standard membership provider). Everything works well, I can log in , log out, get roles, etc... However, after deploying my site to the intranet IIS server I noticed that IE cannot be authenticated. The actual authentication process for logging in works (as it does tell you when your password/username is wrong) but after authentication completes it claims you aren't logged

ASPXAUTH cookie is not being saved

久未见 提交于 2020-01-02 03:41:26
问题 Im working on a web project in ASP .NET MVC 2. In this project we store some info inside an ecripted cookie (the ASPXAUTH cookie) to avoid the need to query the db for every request. The thing is the code for this part has suddenly stopped working. I reviewed the changes made to the code on the source control server for anything that could be causing it, I found nothing. I even reverted to a known working copy (working on some other persons PC, same code, etc) but after debugging, it seems

ASP.NET MVC 3 - Dealing with Session variables

百般思念 提交于 2020-01-02 03:16:09
问题 I have an app which uses Form's Authentication and when the user log's in, I retrieve the user's actual name and assign that to a session variable, like so: [HttpPost] public ActionResult LogOn(LogOnModel model, string returnUrl) { if (ModelState.IsValid) { if (Membership.ValidateUser(model.UserName, model.Password)) { Session["Name"] = client.GetName(model.UserName); FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe); return RedirectToAction("Index", "Home"); } } } This is