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

Forums / Developing with Sitefinity / Ajax Login posiible?

Ajax Login posiible?

2 posts, 0 answered
  1. jcrichto
    jcrichto avatar
    35 posts
    Registered:
    14 Aug 2012
    20 Feb 2009
    Link to this post
    We are trying to do this in an ajax request.  It works up to theSetAuthenticationCookie.

     
      public string Login(string username, string password) 
        { 
            string msg = String.Empty; 
            try 
            { 
                bool isvalid=um.ValidateUser(username, password); 
                if (isvalid) 
                { 
                    Page p = (Page)HttpContext.Current.Handler; 
                  
                    HttpCookie cookie = p.Response.Cookies[FormsAuthentication.FormsCookieName]; 
                    um.SetAuthenticationCookie(cookie); 
                    msg = "success"
                } 
                else 
                    msg = "invalid"


    The ERROR is :


    Error Occured:
    System.ArgumentException: Invalid value for ’encryptedTicket’ parameter.
    at System.Web.Security.FormsAuthentication.Decrypt(String encryptedTicket)
    at Telerik.Security.UserManager.SetAuthenticationCookie(HttpCookie cookie)
    at UserMethods.Login(String username, String password) in \App_Code\UserMethods.cs:line 56

    Thanks!
  2. Parvan
    Parvan avatar
    151 posts
    Registered:
    24 Sep 2012
    20 Feb 2009
    Link to this post
    Hi Jeremy,

    Thank you for contacting us.

    If you upgrade to version 3.6, you can follow the instructions in this article -
    http://www.asp.net/learn/ajax/tutorial-03-cs.aspx.

    You can use the described AJAX login method to login using username and password credentials.

    Hope this information will helps you.

    Kind regards,
    Parvan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
2 posts, 0 answered