Always getting anonymous identity using OpenAccessMembership

Posted by Community Admin on 04-Aug-2018 12:38

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

All Replies

Posted by Community Admin on 05-Feb-2016 00:00

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;
else
    result = SecurityManager.AuthenticateUser(
        providerName,
        input.UserName,
        input.Password,
        input.RememberMe,
        out user);

The setup in my web.config is:

<membership defaultProvider="Default">
  <providers>
    <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"/>
  </providers>
</membership>
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?

Posted by Community Admin on 10-Feb-2016 00:00

Hello,

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.

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

This thread is closed