Continuing to use OpenAccessMembership37Provider membership after upgrade from 3.6
Hi
After an upgrade from 3.6 to 5.2 I can now access members and roles through the OpenAccessMembership37Provider via the API.
What I now want to be able to do is allow members to log into the site via the standard asp:Login control. I think at the moment my settings must be such that I am using the default membership provider which means the OpenAccess members can't log in.
I changed my membership default provider to the following in my web.config file
<membership defaultProvider="OpenAccessMembership37Provider">
<providers>
<clear/>
<add name="OpenAccessMembership37Provider" type="Telerik.Sitefinity.Modules.Migration.Security.Data.OpenAccessMembership37Provider, Telerik.Sitefinity.Migration"/>
</providers>
</membership>
but this can't be quite right as I'm getting the following error
Provider must implement the class 'System.Web.Security.MembershipProvider'
Is someone able to point me in the right direction so that migrated users in the openaccess provider can log in via the asp:Login control?
Also, I have just read a post (http://www.sitefinity.com/developer-network/knowledge-base/changing-the-default-membership-provider-after-migration-from-3-7-to-4-x) that states that all new users will be automatically saved under the default membership provider and best practise would be to migrate all existing users into the new default provider.
Is this still the case, because I'm sure I've read elsewhere that the OpenAccessMembership provider can continue to be used. Maybe I missunderstood, but I assumed that this would mean that new members could be added to the same provider that existing members being to. We are not wanting to reset all member passwords if at all possible.
Is someone please able to clarify this for me?
Thanks for any help.
Is anyone able to help me with this question?
I have the same question. Sad that nobody answered yours. It seems these forums are not read very much.
Hi,
Try the following settings in your web.config:
<
membership
defaultProvider
=
"OpenAccessMembership37Provider"
>
<
providers
>
<
clear
/>
<
add
name
=
"Default"
type
=
"Telerik.Sitefinity.Security.Data.SitefinityMembershipProvider, Telerik.Sitefinity"
/>
</
providers
>
</
membership
>
Telerik.Sitefinity.Security.Data.SitefinityMembershipProvider
that we register is an implementation that allows us to provide support with the .NET MembershipProvider derived classes, so this entry should remain like it is.SecurityManager.AuthenticateUser(
"Default"
,
"username"
,
"password"
,
true
);
Thanks Stefani.
Since my user is in the OpenAccessMembership37Provider, I still had to call:
SecurityManager.AuthenticateUser("OpenAccessMembership37Provider", userName, password, false);
instead of "Default". I added the code in <asp:Login OnAuthenticate="...
I also used "false" for the "persistent" parameter. I was getting some weird situation where apparently the user was still logged in somewhere else, but the ASP LoginName control was not showing the username (after I login and close and reopen the browser). BTW, I'm upgrading a 3.7 site to 6.2. So, I'm not rewriting all those controls, just trying to get them to work correctly.
As for the change in Web.config, I did that. But as it relates to the API to login a user, I still have to pass the "OpenAccessMembership37Provider", so it's not useful in this case. I suppose if I have some other calls to the membership API elsewhere, then that code should use the OpenAccessMembership37Provider instead of Default automatically.
Thanks,
Michael
Hello,
You could try to call:
var validate = SecurityManager.AuthenticateUser(UserManager.GetDefaultProviderName(),
"admin"
,
"password"
,
false
);