1

I have an existing webapp and i'm attempting to setup BlogEngine .Net to share the membership tables

Everything seems to work.. accept i can see that the Membership.ValidateUser call in blogengine returns false! While the other apps returns true.

I'm at a loss.. Membership.GetUser called from both apps returns the correct user..

Any ideas? thanks!

bill
  • 905
  • 5
  • 10
  • 21
  • you might need to share session state, but more info is needed to provide a better answer – JohnIdol May 31 '10 at 19:33
  • Duplicate of http://stackoverflow.com/questions/2274688/using-one-asp-net-membership-database-with-multiple-applications – Rob Windsor May 31 '10 at 19:49
  • no a duplicate. I am not looking to have the user authenticated from one app to another. ONLY to SHARE the membership tables so that creating an account on the one app means you have an account on the other. – bill May 31 '10 at 19:52
  • 1
    I don't know which code to show you. The only thing of interest is the connection string (same and confirmed working on both apps), the membership provider info which is the same, and rolemanager info.. again the same.. – bill May 31 '10 at 19:57

2 Answers2

2

In the web.config, for each application, there is a setting called applicationName. This setting is there so that you can use a single users table with many applications. Now, the ASP Membership provider uses this as part of the query to find users. If this does not match on all of your web.configs and for each user records in the database, you will get a false login attempt if you are logging in from an non-matching application as that user does not belong to the application from which they are trying to log in. If they don't match, change the setting in the web.config and ensure that they all match in the DB tables as well.

Tommy
  • 39,592
  • 10
  • 90
  • 121
1

make sure

<machineKey validationKey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" decryptionKey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" validation="MD5"/>

is the same in both web.configs

bill
  • 905
  • 5
  • 10
  • 21