Membership provider

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
gilesroberts
Ensign (ENS)
Ensign (ENS)
Posts: 10
Joined: Wed Nov 26, 2008 5:43 am

Membership provider

Post by gilesroberts » Wed Nov 26, 2008 12:10 pm

Dear All,

I'm integrating Able Commerce with an existing customers login system. What they'd like to be able to do is have users who've registered on one of their other websites to be able to log in to the store without having to register separately through Able Commerce.

To this end I've written a membership provider that inherits from AbleCommerceMembershipProvider. I've overridden all the methods with extensions where necessary interact with the external registration data. I've altered the web.config to change the default provider to my new one. The only problem I'm having now is my provider code doesn't seem to be called when a user logs in or registers via Able.

First up, I'd like to know if the above approach a sane one? If so, could somebody give me a clue as to why my provider isn't being called at the appropriate moment?

I'm starting to think maybe I should alter LoginDialog.ascx.cs instead.

Regards Giles.

gilesroberts
Ensign (ENS)
Ensign (ENS)
Posts: 10
Joined: Wed Nov 26, 2008 5:43 am

Re: Membership provider

Post by gilesroberts » Thu Nov 27, 2008 4:02 am

Some more information:

I've altered the membership section in my web.config to the following:

<membership defaultProvider="NonExistentAbleMembershipProvider">
<providers>
<clear/>
<add name="CustomisedAbleMembershipProvider" connectionStringName="AbleCommerce6" applicationName="/" type="DataAccess.Controllers.CustomisedAbleMembershipProvider"/>
</providers>
</membership>

The default provider does not exist. The only provider I've listed is my new one. When I compile the website and login as a customer I would expect one of two things to happen

1. Be informed that the default provider doesn't exist.
2. Use my CustomisedAbleMembershipProvider class to access the alternate user database.

What actually happens is that Able Commerce logs me in without complaint using what is I assume to be AbleCommerceMembershipProvider.

gilesroberts
Ensign (ENS)
Ensign (ENS)
Posts: 10
Joined: Wed Nov 26, 2008 5:43 am

Re: Membership provider

Post by gilesroberts » Thu Nov 27, 2008 7:48 am

I've sorted it. On the initial login, the membership provider is not called. It is called in many other places though, returning the expected results. So I've added some custom code to LoginDialog.ascx.cs to validate against my membership provider.

Jwake7
Ensign (ENS)
Ensign (ENS)
Posts: 11
Joined: Mon Jun 30, 2008 8:44 pm

Re: Membership provider

Post by Jwake7 » Tue Dec 16, 2008 9:25 pm

I am trying to accomplish this same thing, but with the Affiliate Wiz application. I would like for Ablecommerce users to feel like they are within the same application when switching between Able and AffiliateWiz. The way it is set up now they have to re-login when switching between the two.

Please explain (in detail if you have time) how you created a membership provider that works with Able and another application. Thank you.

gilesroberts
Ensign (ENS)
Ensign (ENS)
Posts: 10
Joined: Wed Nov 26, 2008 5:43 am

Re: Membership provider

Post by gilesroberts » Wed Dec 17, 2008 3:18 am

Dear Jwake7,

That isn't quite what I've done. Users of my application can't move transparently between Able Commerce and the website I've integrated with. They can sign in with the same login details though and get differential pricing based on their membership level on the other website.

If you're looking for a single sign on with transparent moving between the two websites you may be better off looking at this topic:

viewtopic.php?f=42&t=8080&p=34590&hilit ... der#p34590

Regards Giles.

Post Reply