Problem using on subsites

Thanks for FBA Pack.  It works fine on one of my web apps but not on another.  The one it works on has one site collection/site.  The one it doesnt work on has one site collection but multiple sub sites.  It works on the root site, but not on subsites.  For example on subsites that are three layers deep whenever clicking on FBA User Management or FBA Membership Request Management it jumps to those pages at the root site level.  Clicking FBA Site Configuration, however, stays at the appropriate subsite page.  When trying to create a new user from the member request web part on a subsite page a generic sharpeoint error message page is shown.  Member request web part on the root site level works, though.  Any help greatly appreciated.

It jumps to the page at the root site level, as the single page is meant for managing the complete site collection.  Unfortunately there is currently a bug where if a group wasn't created at the site collection level you'll get an error. I think that's what you're experiencing.  The fix will be in the next release.  If you'd like a fix now, you can compile from source as the fix has already been checked in.

Yes, that seems to be it, thanks.  I created a sharepoint group at the root level and then was able to create a user into that group from a membership request page at a subsite level.  However, the group must have permissions at the root level or an error is thrown.  That wont work for my scenario since users at the subsite should not have permissions at any higher levels.  Sounds like the fix you mention above will take care of that.  When do you expect the next release?

I expected it to already be out, but got busy.  Things have calmed down now though, so if things stay that way then probably by the end of the week (but no promises!).

cool.  I'll install and udpate you on how it worked out for me.  Thanks

Installed 1.2 but the behavior here seems the same.  A new user created on a subsite wont get added into an SP group unless that group has permissions at the root level.  The group doesnt just need to have been created at the root level, it also needs to have permissions (even just restricted read) at the root level. 

Also, even if I approve the user and manually add him to a subsite group that does not have permissions at the root, the system doesnt send the 'new account' email, which means the user doesnt get a password.

Interesting, I didn't run into the same issues when testing on my side.  Does everything work fine, including the email, if the group was created at the root level?  Sending the email should depend on the permissions of the person currently logged in, and it's setup so it should even work if the user is accessing via anonymous access.  If the email isn't being sent, there should be an exception in the SharePoint log file - could you check that and maybe we'll be able to figure out what's going on.

Here are the logs showing an error when creating a user.  In this setup FBA Pack was configured to create users automatically upon account request submission.  The membership webpart was on an anonymously accessible page on a subsite.  It was configured to enter users into a group that was created at the root site collection but which only has permissions configured at the subsite level (Contirbute).

Below are the entries from the ULS logs:

12/01/2011 12:26:01.45 w3wp.exe (0x048C) 0x1BC0 SharePoint 2010 FBA Pack General 0000 High System.Exception: Group cannot be found.     at Visigo.Sharepoint.FormsBasedAuthentication.MembershipRequest.ApproveMembership(MembershipRequest request, SPWeb web) 4a6a5fec-e273-470b-a5af-c36132518c72
12/01/2011 12:26:01.45 w3wp.exe (0x048C) 0x1BC0 SharePoint Foundation Runtime tkau Unexpected System.Exception: Group cannot be found.    at Visigo.Sharepoint.FormsBasedAuthentication.MembershipRequest.ApproveMembership(MembershipRequest request, SPWeb web)     at Visigo.Sharepoint.FormsBasedAuthentication.MembershipRequestControl.<>c__DisplayClass2.<OnCreatedUser>b__0()     at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.<RunWithElevatedPrivileges>b__2()     at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)     at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)     at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)     at Visigo.Sharepoint.FormsBasedAuthentication.MembershipRequestControl.OnCreatedUser(EventArgs e)     at System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser()     at System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e)     at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e)     at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)     at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 4a6a5fec-e273-470b-a5af-c36132518c72

I see the 'group cannot be found' error.  The group does indeed exist, and I can manually enter FBA and AD users into it (the site suscesfully using mixed mode auth)

The group was created by a Site Admin user. 

I'm wondering if maybe a wrong value is stored in the web part properties for the group.  Can you edit the web part, change the group, save the changes, edit again, re-select the group you would like to use and save the changes.

I've edited the web part as you suggested, to no avail.  I've tried every combination of settings I can think of, including trying different subsites (and different subsite levels), the user who created the group/edited the web part (tried with FBA and AD users, both site admins), the group permissions (e.g., Contribute, Full).  I find that the subsite group must have permissions at the root site or the 'group cannot be found error is thrown at the "\" level.

I tried to reproduce this, just to make sure I didn't miss anything. Here's what I did:

Created a site under the root site. Allowed anonymous access on this site.

Created a group, did not give the group ANY permissions at all.

Added a membership request web part to this sub site. Edited the web part properties to use my new group.

Logged out and visited the page as an anonymous user. Created a user using the web part. No errors

Logged back in and checked the users in the group - the new user had been added to the group.

 

So it seems to be working properly. Are you sure that the version 1.2 was properly deployed? Maybe try a redeploy.  Otherwise, i'm thinking there's something special with your configuration.  Maybe, if you have it available and are handy with it, deploy a debug version with Visual Studio and do a debug to root out the problem.

I'll try the scenario exactly as you describe. I'm using mixed-mode authentication. Also, the membership request page is anonymous, but the rest of the subsite, and the root site, is not. Might either of those matter?







From: [email removed]
To: [email removed]
Date: Sun, 4 Dec 2011 11:40:13 -0800
Subject: Re: Problem using on subsites [Sharepoint2010FBA:277643]

From: ccoulson
I tried to reproduce this, just to make sure I didn't miss anything. Here's what I did:
Created a site under the root site. Allowed anonymous access on this site.
Created a group, did not give the group ANY permissions at all.
Added a membership request web part to this sub site. Edited the web part properties to use my new group.
Logged out and visited the page as an anonymous user. Created a user using the web part. No errors
Logged back in and checked the users in the group - the new user had been added to the group.

So it seems to be working properly. Are you sure that the version 1.2 was properly deployed? Maybe try a redeploy. Otherwise, i'm thinking there's something special with your configuration. Maybe, if you have it available and are handy with it, deploy a debug version with Visual Studio and do a debug to root out the problem.
Read the full discussion online.
To add a post to this discussion, reply to this email (Sharepoint2010FBA@discussions.codeplex.com)
To start a new discussion for this project, email Sharepoint2010FBA@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com

They shouldn't matter, and I just did a quick test to verify. I:

turned off anonymous access on the root site

Set anonymous access to libraries only on the sub site. Enabled anonymous read access on the library containing my registration page.

Now the anonymous user can only hit the registration page anonymously.

I was able to register with no errors, and the user was added to the group. 

Yeah, that was it. Didn't have 1.2 installed like I thought we did. Working perfectly now. Sorry for the inconvenience.







From: [email removed]
To: [email removed]
Date: Sun, 4 Dec 2011 12:01:23 -0800
Subject: Re: Problem using on subsites [Sharepoint2010FBA:277643]

From: ccoulson
They shouldn't matter, and I just did a quick test to verify. I:
turned off anonymous access on the root site
Set anonymous access to libraries only on the sub site. Enabled anonymous read access on the library containing my registration page.
Now the anonymous user can only hit the registration page anonymously.
I was able to register with no errors, and the user was added to the group.
Read the full discussion online.
To add a post to this discussion, reply to this email (Sharepoint2010FBA@discussions.codeplex.com)
To start a new discussion for this project, email Sharepoint2010FBA@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com