I installed Beta 2, and would like to point the Membership provider to use the same DB as my main app. I followed the instructions that Jose listed in this thread: http://communityserver.org/forums/t/484807.aspx , as far as copying the SPs etc. Also, i was sure to change the connection string to the new string i made for my main apps, and also changed the application name to the same one I use in my main application.
I also made sure that in my main apps db table, i created a user called admin with the same password as what I setup when i created the install of CS.
I am still getting the error message "A null MembershipUser is not valid to instantiate a new User".
If I set the connection string back to the original setting, everything works fine again. Basically when i point it to my existing database, it gives me that error.
Any thoughts what i could try to get this integrated?
Still not getting this to work, if anyone could help i would really appreciate it.
Hi Sharbel,
Sorry for the delay in getting back to you.
Where are your roles pointing? (local CS database? or remote database?) If roles are stored in you main app, then it's possible that you don't have the roles required by Community Server in that application. Similarly, unauthenticated requests go thru the Anonymous user so you'll need to, at a minimum, have two users in your membership store.
Let me know if that helps...
One is glad to be of service...
Hi Jose,
I have tried both my local CS db as well as my main app's db for the roles. What i mean, is that i set all the providers to my main apps, and got that message... then i tried just changing the membership provider to my main app and still got the same message.
Regarding the Anonymous and Admin user, i did create 2 users with the same username/password as those created in the CS db.
I think the issue is related to IDs that are not properly synchronized.
First, in order to get this all working, I'd recommend you select the desired location for membership/profile/roles and we'll walk thru that scenario. Trying to solve it for two scenarios is guaranteed to lead to much confusion
So, for example, if we work with membership/profile in the main database and roles in the CS database, then you'll need to make sure that the aspnet_UsersInRoles table (in the CS db) is using the UserIDs from your main app's database and tied to the roles in your CS database. Otherwise, when the role lookup is performed, your admin/anonymous user won't belong to any roles and you'll be unable to properly access the site.
Make sense?
It turned out to be a couple things that arent really documented in your tutorial. Besides doing everything you mentioned in this thread: http://communityserver.org/forums/t/484807.aspx , i needed to correct the following:
1) I had to set the ApplicationName as 'dev' in my main app, *not* add my ApplicationName of my main app. even if I added an attribute of applicationName="myappname" to the CS provider lines, it would always use the 'dev' id. If i changed the applicationname in the database, the program would give me the Null Membership user error. So, to be clear, i had to set the ApplicationName of my main application to 'dev' in the aspnet_Applications table.
Once step #1 was complete, i was able to load the site, but was getting a Role Not Found type error (handled error by CS, had the full CS pages loaded, just all pages except the login page would have the Role Not Found error box in the middle of the screen.
2) I added all the roles that were present in the CS database, in my main sites database. I was very very careful to make sure all the spelling was correct of the rolenames etc. But i needed to *copy the roleID* as well as the the role names! So, if you just add the Roles via your back-end or ASP.NEt configuration tool, it will *not* maintain the IDs (obviously). I honestly don't know what the IDs would have to be the same, since its usually looked up by the RoleName?
Once step #2 was done, everything worked great!
Now i see RC1 is out, i hope i dont have to do this all over again
You shouldn't need to do #1. My guess is that the ApplicationName in your cs_SiteSettings was never modified. This is set when you create a community. (Since you mentioned you had already synched appNames, I didn't think to have you verify this...sorry)
As for step #2, that's what I was referring to in my earlier response (but I was assuming you'd go with local roles and need to synch UserIDs). It's necessary that RoleIDs match since that's how permissions are tied in. This is how a remote database and referential integrity is maintained in both the cs_ProductPermissions and cs_SectionPermissions table.
All upgrades keep data intact, so you will not need to redo any of this.
Aha! you are 100% right about cs_SiteSettings.. i didnt realize the appname was stored there, thanks for clearing that up. Even though I got it going, I still wanted to know *why* I got it going.
Gotcha on the roleIDs.. makes sense.
You da man Jose, thanks for all your help!
Once you restart the app, the SiteSettings get reloaded
unfortunately that doesn't work. the property ApplicationName will not deserialize into the SiteSettings object because the ApplicationName property is marked "XmlIgnore"...no matter what you do the code won't read it in when you deserialize the object from the XmlDocument....
Never mind, I didn't see it was an additional column in the table..
I have read that intructions and all the follow-ups and I still can't get morpheus to work.
my scenario is a local roles/profiles, with remote membership/users.
my steps are as follows.
1. installed a clean community server. setup up database and "created community"
2. Created the 5 sprocs that relate to membership (didnt need the cs_roles or cs_profiles)
3. Created an Application in my remote database named dev using the same appid created in community server
4. Copied over the users anonymous and admin with the existing userids and appids
5. created a SqlMembershipProvider that implemented IExtendedMembershipProvider
6. edited communityservers web.config to use the new SqlMembershipProvider (with implementation)
I get "A null MembershipUser is not valid to instantiate a new User"
Hi Edward,
edwardgeini: I get "A null MembershipUser is not valid to instantiate a new User"
Did you create a second connection string and point the provider in #5 to that new connection string?
When do you get this error? Is it when you hit the site as the Anonymous user before logging in? Is it for new user created after you've wired up your new membership provider?
Looking forward to helping you out...
i should of mentioned that, but yes. i did create a new connection string and pointed to it.
I'm getting the error before default.aspx even loads. I'm guessing that the problem has to do with the anonymous acount.
Yes this anonymous acount was created by me. I copied that values from the community server database (appid and userid) over to the remote database.
Copyright© 2008 Telligent Systems Inc. All rights reserved CommunityServer.com • Telligent.com