Solved

ASP.NET 3.5 | IIS7 | Forms Authentication Does Not Work

Posted on 2014-03-27
6
470 Views
Last Modified: 2014-05-28
Hello,

I have uploaded my asp.net 3.5 on my new webserver that runs iis7.

The website works fine, but when I try to log in to my sign in page (which uses forms authentication to save users credentials in a cookie), it does not authenticate the user.

It works fine on my local laptop so it seems that there is an option that I need to enable on the iis7.

Any help?
0
Comment
Question by:feesu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 5

Assisted Solution

by:indrajitmahajan
indrajitmahajan earned 100 total points
ID: 39958407
hi..

If you want to enable authentication on your website for your users you can even leave the anonymous user and windows authentication enabled, so IIS will accept all the request coming to the webserver. You can then use form authentication (implemented with the SignIn method in the login page) to grant your visitors access to only certain parts of the website using the asp.net membership.

For more details:
http://support.microsoft.com/kb/301240
0
 
LVL 26

Assisted Solution

by:Alan Warren
Alan Warren earned 100 total points
ID: 39958581
Hi feesu,

I suspect that the applicationID in the table/s aspnet_Membership and aspnet_Users is different on the live site than on your local machine, possibly because the ApplicationName is different. Check the SQL table aspnet_Applications, before and after you create a new user on the live site, you will probably find you have more than one application, one (your local app) and one (your live site), Asp .Net Membership supports multiple applications.
Scott Gu's blog "You should ALWAYS customize the Membership provider and specify an applicationName"...
    <membership defaultProvider="CustomizedProvider" userIsOnlineTimeWindow="20">
    <!-- passwordFormat="Hashed" note hashed passwords cannot be retrieved-->
      <providers>
        <clear/>
        <add connectionStringName="cnMyConnection" enablePasswordRetrieval="true" passwordFormat="Encrypted" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" maxInvalidPasswordAttempts="32000" passwordAttemptWindow="10" minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="1" passwordStrengthRegularExpression="" applicationName="MySiteName" name="CustomizedProvider" type="System.Web.Security.SqlMembershipProvider"/>
      </providers>
    </membership>

Open in new window

I think you will find that if you sign up a new member on the live site, things will work as expected, but it won't work for members you created on your local machine, because the applicationID and possibly the ApplicationName differ.

Update aspnet_Membership set ApplicationID='theapplicationoftheuseryoucreatedonthelivesite'  
-- same for the other membership tables that require  appilication id

Open in new window


Respectfully yours,
Alan
0
 

Author Comment

by:feesu
ID: 39964738
Experts,

Thank you for your feedback.

My problem is not with code. My code has been running perfectly for years. However, this is the first time I upload my website to an IIS7 web server. That's the reason probably, and I am sure it is a certain setting in the IIS itself.

Any recommendation on that?
0
Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

 
LVL 6

Accepted Solution

by:
mwenenko earned 300 total points
ID: 40076128
Have you installed and enabled Forms Authentication module in IIS 7? Can you post a screenshot of Authentication types from IIS console?
0
 

Author Comment

by:feesu
ID: 40089368
Hi mwenenko,

Please see if the attached helps.

Thanks
snap.png
0
 

Author Comment

by:feesu
ID: 40095224
Ok, I think I've figured it out. Thanks.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question