+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Claims authentication and persistent login problem

Claims authentication and persistent login problem

3 posts, 0 answered
  1. Leonidius
    Leonidius avatar
    10 posts
    Registered:
    02 Jul 2014
    10 Jun 2015
    Link to this post

    I have a code snippet which is supposed to do programmatic login using a custom membership provider. We use claims authentication with Sitefinity 7.1.  For some reason the persistent flag seems not to work.

    var authenticationResult = SecurityManager.AuthenticateUser("Pivotal.MembershipProvider", userName, password, rememberMe);

    I did some digging inside the code and found a place which I believe is responsible for setting the cookie, There the code checks for Authentication mode and sets the cookie only if mode is Forms.

    So my question is -- how to make this functionality available in Claims authentication mode ?

    if (SecurityManager.AuthenticationMode == Telerik.Sitefinity.Security.Configuration.AuthenticationMode.Forms)<br>          SecurityManager.SetAuthenticationCookie(SystemManager.CurrentHttpContext.Response, manager.Provider.Name, user, rememberMe, issueDate);
  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    22 Sep 2016
    15 Jun 2015
    Link to this post
    Hello,

    The persistent flag will now persist the user unless the setting in Administration->Settings->Advanced->Security AuthCookiePersisten is checked. Go and update this setting to persist the auth cookie.

    Regards,
    Stanislav Velikov
    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
     
  3. Leonidius
    Leonidius avatar
    10 posts
    Registered:
    02 Jul 2014
    18 Jun 2015
    Link to this post
    That worked. Thank you !
3 posts, 0 answered