More in this section
Forums / Developing with Sitefinity / Always getting anonymous identity using OpenAccessMembership37Provider in Sitefinity 8 (default provider in parrallel)

Always getting anonymous identity using OpenAccessMembership37Provider in Sitefinity 8 (default provider in parrallel)

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Wolfgang
    Wolfgang avatar
    1 posts
    22 Dec 2015
    05 Feb 2016
    Link to this post

    I hav to use both the lagacy and default membership provider on the site. So I enabled the OpenAccessMembership37Provider in sitefinity's backend.

    After I've managed to imort the users from an old sitefinity site into the the new, I encountered a rather strange issue:

    I am actually able to log in using an imported user's credentials. I use a trial-and-error approach to find out about the provider to use:

    User user = null;
    UserLoggingReason result;
    var providerName = UserManager.GetDefaultProviderName();
    var userId = SecurityManager.GetUserId(providerName, input.UserName);
    if (userId.Equals(Guid.Empty))
        providerName = "OpenAccessMembership37Provider";
        userId = SecurityManager.GetUserId(providerName, input.UserName);
    if (userId.Equals(Guid.Empty)) result = UserLoggingReason.Unknown;
        result = SecurityManager.AuthenticateUser(
            out user);

    The setup in my web.config is:

    <membership defaultProvider="Default">
        <clear />
        <add name="Default" type="Telerik.Sitefinity.Security.Data.SitefinityMembershipProvider, Telerik.Sitefinity" />
        <add name="OpenAccessMembership37Provider" type="Telerik.Sitefinity.Modules.Migration.Security.Data.OpenAccessMembership37Provider, Telerik.Sitefinity.Migration"/>
    Not sure if this is a good setup.
    Now, authenticated as a user in the legacy provider, I get the correct Identity via ClaimsManager.GetCurrentIdentity() in any control as long as it is situated on a page that hasn't been visited before, since a restart of the site. When I visit a page having been already rendered before the login, ClaimsManager.GetCurrentIdentity() returns anonymous.

    So I've been looking arround for a possibility to try out both providers when retrieving the current identity (similar to the login procedure), but havent found so far. My best guess was this might be a type of a caching issue, but if so, why does this work with the default provider? Is there something wrong with my setup?

  2. Velizar Bishurov
    Velizar Bishurov avatar
    143 posts
    18 Sep 2017
    10 Feb 2016
    Link to this post

    I have noticed that you have already opened a support ticket for this issue. I suggest we continue the communication there and once we have the solution figured out feel free to post it here for the community.

    Velizar Bishurov
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
2 posts, 0 answered