Continuing to use OpenAccessMembership37Provider membership

Posted by Community Admin on 05-Aug-2018 21:24

Continuing to use OpenAccessMembership37Provider membership after upgrade from 3.6

All Replies

Posted by Community Admin on 08-Feb-2013 00:00

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.

Posted by Community Admin on 18-Feb-2013 00:00

Is anyone able to help me with this question?

Posted by Community Admin on 29-Nov-2013 00:00

I have the same question. Sad that nobody answered yours. It seems these forums are not read very much.

Posted by Community Admin on 02-Dec-2013 00:00

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>

By default the 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.

The OpenAccessMembership37Provider may not be enabled in your project, so you need to go to Administration->Settings->Advanced->Security->MembershipProviders and enable it (here is a screenshot). The web.config entry remains the same

Now when you go to Administration->Users the list of the availble providers will be shown above the "Create a User" button and also when creating a user there is an option to decide where to create this user (here is ascrrenshot).

Note that in Sitefinity 5.x and 6.x  the authentication is different that the authentication in Sitefinity 3.x. Sitefinity 3.x uses asp.net membership providers and the general asp.net approach, but in Sitefinity 5.x and 6.x the membership and role providers are still inheriting from asp.net built in providers, but the methods for authenticating a user are different this means using asp login control they will not work.

A user in Sitefinity can be authenticated by calling the security API in Sitefinity:
SecurityManager.AuthenticateUser("Default", "username", "password", true);

Use SecurityManager to authenticate a user in Sitefinity from custom login control by inputting the username and password.

Regards,
Stefani Tacheva
Telerik
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 02-Dec-2013 00:00

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

Posted by Community Admin on 05-Dec-2013 00:00

Hello,

You could try to call:

var validate = SecurityManager.AuthenticateUser(UserManager.GetDefaultProviderName(), "admin", "password", false);

Regarding the migration of the controls all controls that you have created in 3.x ( that do not come out of the box in Sitefinity 4.x / 5.x/ 6.x ) need to be rewritten using our new API. You cal also use Sitefinity Thunder add - on for creating widgets and modules easily. You could take a look at this section of our Sitefinity documentation.

We also have a KB article on how to migrate custom widgets to 4.x / 5.x/ 6.x:

www.sitefinity.com/.../custom_widgets_migration


Have in mind that we have started version Sitefinity 4.0 from scratch. This let us revise the architecture from scratch and incorporate all lessons we learned while working on Sitefinity 3.X. Note that the differences in the architecture and structure ( and logic ) between the 3.x versions and the 4.x / 5.x/ 6.x are huge.

The best option in your case would be, knowing the 3.x implementation and the final result of each control to redesign and recreate the controls in a way that you can achieve the same result in Sitefinity 4.x/ 5.x/ 6.x  In order to replicate the behavior of controls for the new Sitefinity website, I would suggest to review the following resources:

1. Developer documentation.

2. How to ( custom code samples )

3. Our SDK

4. Our Blogs, which contain posts with custom implementations.

5. API reference.

We have API reference, which can help you through the development process - if you want to get the latest release of the API reference document, you can check the following article, which contains a direct link for downloading the files:

www.sitefinity.com/.../api-documentation-for-sitefinity

Regards,
Stefani Tacheva
Telerik
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed