MOSS 2007 site with both Anonymous and Froms authentication

Topics: FBA, Forms Based Authentication, MOSS, SharePoint
Mar 22, 2008 at 1:58 PM
I have a requirement as follows:
1. There is a MOSS 2007 site, the top level site collection is enabled with Anonymous access.
2. The rest of sub sites called,,, are enabled with Forms Authentication.
3. Since the is enabled with anonymous access, everybody can access and see the content of the home page of site. If the user clicks on any of those sub sites, it prompts for credentials.
4. In order to access/view the content of sub sites, users must register and login.
5. Everything is working fine with MOSS out of box FBA configuration settings, but I dont want to use the default forms authentication login page & controls.
6. I have created a custom login control (web part) and placed on's default.aspx page and coded as below

1. protected void HStarLogin_Authenticate(object sender, AuthenticateEventArgs e)
2. {
3. if (Membership.ValidateUser(HStarLogin.UserName, HStarLogin.Password))
4. {
5. LoginStatus.Text = "Logged in successfully";
6. ----------------
7. }
8. else
9. {
10. LoginStatus.Text = "Logged in failed";
11. }
12. }

The above code works fine and checking whether the user exist in custom user database (aspnetdb created with aspnet_regsql.exe during FBA configuration of my site).
But, how to provide the access in my code to the sub sites to the logged in user (FBA Enabled sub sites) after successful validation?
I have stucked for the code that should be present at line 6 in the above code snippet.
Can anyonly provide me how to achieve it, appreciate your help.

Apr 29, 2008 at 7:23 PM

can you pls tell me steps for enabling FBA authentictaion on subsite under root site? So far only way I know is extend webapplication in different zone and configure FBA on it.

Please reply ASAP.

May 8, 2008 at 8:51 AM
Its simple. Follow the setps to to configure the site with FBA. Along with this,

1. check the "Allow Annonymous Access" in while configuring the Authentication Providers for your site collection just after checking the "Forms" in the authentication section.

2. Go to your site collection's Settings --> Advanced Settings (below people and groups).
3. Check "Entire Site" for top level site collection.
4. Repeat the step 2 for all other child sites and set "Nothing".