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

Forums / General Discussions / custom operation on validating user identity

custom operation on validating user identity

9 posts, 0 answered
  1. Bassem
    Bassem avatar
    19 posts
    Registered:
    29 Dec 2010
    18 Mar 2011
    Link to this post
    Hi

    When logging, I wanna be able to look for some information after validating the identity of the user ans save it to the Session object.
    How could this be done ?
    should I develop my own UC or the one in SF could be useful with some customization
    thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    18 Mar 2011
    Link to this post
    Hi Bassem,

    You can override LoginForm_Authenticate method of  Telerik.Sitefinity.Web.UI.PublicControls.LoginControl and then check if the user is authenticated if(!e.Authenticated)

    Best wishes,
    Ivan Dimitrov
    the Telerik team
  3. Bassem
    Bassem avatar
    19 posts
    Registered:
    29 Dec 2010
    18 Mar 2011
    Link to this post
    Hi Ivan 
    Thank you for the response, 
    where can I override this LoginForm_Authenticate method of  Telerik.Sitefinity.Web.UI.PublicControls.LoginControl : 
    I should use a UC that uses Telerik.Sitefinity.Web.UI.PublicControls.LoginControl because I cannot see it in my RadControls toolbox in VS. 

    thank you
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    18 Mar 2011
    Link to this post
    Hello Bassem,

    You need a custom class that inherits from Telerik.Sitefinity.Web.UI.PublicControls.LoginControl

    Kind regards,
    Ivan Dimitrov
    the Telerik team
  5. Pik Lee
    Pik Lee avatar
    142 posts
    Registered:
    13 Aug 2012
    18 Mar 2011
    Link to this post
    Can you show me an example?

    Thansk, ~Pik
  6. Pik Lee
    Pik Lee avatar
    142 posts
    Registered:
    13 Aug 2012
    19 Mar 2011
    Link to this post
    Here is my sample code, not sure why the Response.Redirect is not working.
      void Login1_Authenticate(object sender, AuthenticateEventArgs e)
      {
            bool x;
            x = UserManager.GetManager().ValidateUser("username1","userpw");

            if (x.Equals(true))
            {
                Response.Redirect("~/login/select/");
            }
    }

    I received this error message:

    Server Error in '/SitefinityPortal' Application.

    This type of page is not served.

    Description: The type of page you have requested is not served because it has been explicitly forbidden.     Please review the URL below and make sure that it is spelled correctly.

    Requested URL: /SitefinityPortal/login/select/


    Thanks,~Pik
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    21 Mar 2011
    Link to this post
    Hello,

    The page /SitefinityPortal/login/select/ does not exist - this is not the correct url or the user you use does not have view permissions.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
  8. Pik Lee
    Pik Lee avatar
    142 posts
    Registered:
    13 Aug 2012
    22 Mar 2011
    Link to this post
    Thanks for the reply.

    The page does exists. It is working fine if I used the sitefinity login control but not my custom login control. Any idea why?

    Thanks,
    Pik
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    22 Mar 2011
    Link to this post
    Hi Pik,

    Since this page does not exist the problem is in your code and the way that you construct the url. I do not know what the the proper url for your specific SiteMap structure.

    Regards,
    Ivan Dimitrov
    the Telerik team
9 posts, 0 answered