Implement Forms Auth in MOSS.

To save everyone else the potential HOURS of searching trying to figure out why I couldn't get the machineKey section from the web.config for a WSS 3.0 site it turns out that the IUSR_* account does not have read access to the web.config. Once read permissions were granted to the web.config all was fine.

Typically this is not an issue but I changed the site to use forms authentication with a custom membership and role provider. Doing this required reading the machineKey from the web.config to encrypt the password. Since the IUSR*_ account was now the default identity and it didn't have read access to the web.config the login would fail and no errors were logged or reported anywhere. It is worth noting that when you have issues in your membership and/or role provider it can be difficult to track down the error since it isn't always logged for some reason. Also, just because it works in a stand alone web application doesn't mean it will work in WSS 3.0 since by default the web app is full trust and WSS 3.0 is minimal trust.

The good news is we now have a working example of using forms authentication with a custom membership and role provider which allows a WSS 3.0 site to be opened to the internet while maintaining an existing data store for user credentials.

Here reference for some of the file permissions: http://technet.microsoft.com/en-us/library/cc721631(TechNet.10).aspx

Comments

Popular posts from this blog

Print from WPF using ReportViewer Control

Printing SSRS 2008 R2 Reports from C#.

Using IOptions class in .Net Core Unit Testing.