Really Frustrated with BE 1.4.5 Membership and Roles Setup!!!!!

Topics: ASP.NET 2.0
Aug 8, 2008 at 8:33 PM
Hello all you fellow masochists...Definition ( those who enjoy inflicting pain on themselves),

I say this because we must all be crazy.  I have wasted four days trying to get  BE 1.4.5 configured to use ASPNET Membership and Roles with NO success.  Al Nyveldt made it look so easy.  Everyone said that BE was the best .Net2 blog engine around.  I guess it might be if you can ever get it configured or actually integrate it with an existing app.

My goal was to add a blog to an asp.net2 site that already uses the aspnet membership/roles provider in an aspnetdb.mdf -- I attached the aspnetdb.mdf in  SQL Server Studio,  gave it a name, modified my connectionstring in the web.config.  Great, my app still works.  Then I added the BE tables using the setup script...fine.  Added the beUser...fine.  BE is very happy with storing the posts and such in SQL Server BUT everytime I try to log into the blog with a valid user, I get  'Your login attempt was not sucessful. Please try again'.
I can only log in the blog with the xml user admin/admin...

Does ANYONE actually have BE running successfully with users being authenticated using aspnet membership???

Aug 8, 2008 at 11:04 PM
Edited Aug 8, 2008 at 11:05 PM

Hey, newbie man!

Agreed.  It seems membership and user accounts are issues in BE.NET that get more than their fair share of threads on this forum!

Does this thread help you at all.  

http://dbvt.com/blog/post/BE-Sueetie-14-Upgrade-Membership-Provider-Tip.aspx

How 'bout this one?

http://www.codeplex.com/blogengine/Thread/View.aspx?ThreadId=32621

Regards,
Dave

Aug 8, 2008 at 11:32 PM
Hey Dave,

Thanks for the sympathy..I needed that! 

I did find the second thread interesting, I had already tried changing the Membership and RoleProviders from Db to Sql and had sniffed out some issues with the applicationName setting in the web.config <provider> setup....  I'm still deciding whether to bang my head against the wall one more time?  

If I do get BE to recognize my users/roles in the aspnet Membership Provider,  will I be able to run it in a subdirectory (as an application) of my Site and not have the users have to log in to the blog?

Why don't the Powers That BE (the developers of BE that is) clear this up?    I'd much rather move on to the joy of creating my own theme..

Vicky
Aug 9, 2008 at 12:20 AM
Thanks so much Dave, 

I looked at your site at:  http://dbvt.com/blog/post/BE-Sueetie-14-Upgrade-Membership-Provider-Tip.aspx  and then I tried one more time to fix my issue,  setting both the Membership and Role Providers to Sql from Db AND  changed the application name to the exact one stored in the .net membership table aspnet_Applications.  Then I made sure that my applicationName in both my root web.config and the blog/web.config matched that.  

That one more bang of the head WORKED!!!  

Can you tell me if,   now that BE stores and validates against users in my aspnet membership provider tables just like my web app does...how do I get BE  to recognize the user and not have them log in?  I have BE running as an application in a subdirectory of my main site.

I see you have done a great job on your blog and it fits seamlessly in your site...but you made many customizations?  I am not as advanced with .net and just want to use the web version without have to customize and recompile etc. 

U have provided much relief,  thanks again.

Vicky



Aug 10, 2008 at 7:11 PM
Blognewbie,

So glad you're up and running!  I do .NET development for a living so I have an advantage on you.  You should be only another bang of the head away from what you want.  If the parent application and BE as the child application both use the same ASPNET Membership data, and that account has an "Administrators" role, whenever you log in to the parent, you should be recognized in the child (BE) without having to login. Be sure the parent and BE both have the same MACHINEKEY setting in the web.config and the same application name in the SQLRoleProvider and SQLMembership area properties.  You may--may--need to perform a SQL update to physically add your userid to the role for that application GUID if when you login to the parent your BE roles are not being recognized.

Thanks for the kind words about dbvt.com.  I just upgraded it to BE.NET 1.45 earlier today in fact.  (Hope it still works!)  All I can tell you is that when I login to either my Photo Gallery application or BE.NET, both sharing the same ASPNET Membership data, I am logged in to both.  So hopefully you'll have that working as well.  You definitely do not need to compile anything.  It's configuration typing only with some possible SQL query action.

Regards,
-Dave

Aug 12, 2008 at 5:13 PM

Hey Dave...

Yes I have a /blog directory running as a child application in my Parent application directory structure.  I still don't have that 'seamless' authentication going on.  I copied the machine key from the /blog web.config to my parent web.config and verified that my SQLRoleProvider and SQLMembership have the same application name.. 

I DID customize the Membership and Role providers in the main web.config as I stored the aspnet role and member tables in my own db.  I have this in my main web.config:

 <roleManager enabled="true" defaultProvider="CustomizedRoleProvider">
        <providers>
          <add name="CustomizedRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="Inphase" applicationName="/Inphase2"  />
        </providers>
      </roleManager>
      <membership defaultProvider="CustomizedMembershipProvider">
        <providers>
          <add name="CustomizedMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="Inphase" requiresQuestionAndAnswer="false" applicationName="/Inphase2" />
        </providers>      
      </membership>

I checked the DB and the userids are assigned to the right roles and application ids in the aspnet tables.   I still have to Sign In to the blog engine after I've already signed in to the Parent application as an Administrator....  I'm still banging...  Any ideas?  

Regards back....vicky

Aug 13, 2008 at 2:50 AM
In addition to having the machineKey the same between the two web.config files, you also need to make sure that <forms> element under <authentication> has the same name, protection and path attributes.  I have this working on my site where I had SQL Membership and Role providers working for my ASP.NET app and then added the blog engine as a subdirectory / application.

Steve
Aug 13, 2008 at 4:31 PM
Oh man,  thanks so much...that was my problem.   Now when I login in my parent app,  it recognizes the user and role on the blog home page.  Yahooo! 

This is my first attempt at setting up a business blog inside a site.   I don't know much about blogging...I'm mostly a db developer,  so I'm still wrapping my head around the lingo,  like tag cloud and twitter..social networking and all that....  I'm interested in having a blog home page that describes the corporate Authors (Editors role) and then users can link to the authors posts.  So would this be the blog Home Page?  Right now it lists the most recent post.  Any advice you can give me would be appreciated.

Vicky