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

Forums / General Discussions / Invoking Sitefinity authentication

Invoking Sitefinity authentication

8 posts, 0 answered
  1. Paolo
    Paolo avatar
    147 posts
    Registered:
    11 Jun 2009
    15 Apr 2011
    Link to this post
    Hello,
    I've written my custom role provider, now I need to integrate SF with another website I've... this website has its own membership provider (ASP.NET) and I wish to have a link in my application that performs the SF authentication in a silent way..... consider it a passthrought... how can I achieve this?

    Thanks
    Paolo
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    18 Apr 2011
    Link to this post
    Hi Paolo,

    You should have some service that makes a call and authenticate the user.

    Regards,
    Ivan Dimitrov
    the Telerik team

  3. Paolo
    Paolo avatar
    147 posts
    Registered:
    11 Jun 2009
    18 Apr 2011
    Link to this post
    in what sense?
    a service in sitefinity?
  4. Paolo
    Paolo avatar
    147 posts
    Registered:
    11 Jun 2009
    26 Apr 2011
    Link to this post
    hello,
    can someone help me on this? thanks
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    29 Apr 2011
    Link to this post
    Hello Paolo,

    You can use /Sitefinity/Services/Security/Users.svc/ and make HttpWebRequest. The method you should pass to the service is called "Authenticate"
    I will try to prepare a sample an post in on Monday.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  6. Paolo
    Paolo avatar
    147 posts
    Registered:
    11 Jun 2009
    02 May 2011
    Link to this post
    Hello Ivan,
    I've succeded in authenticating using this :

    if (!IsPostBack)
             {
                 Telerik.Sitefinity.Security.Web.Services.Users userService = new Telerik.Sitefinity.Security.Web.Services.Users();
                 Telerik.Sitefinity.Security.Credentials credentials = null;
                 string userName = string.Empty;
                 string password = string.Empty;
                 bool isPersistent = false;
                 if (Request.Params["username"] != null)
                 {
                     userName = Request.Params["username"];
                 }
                 if (Request.Params["password"] != null)
                 {
                     password = Request.Params["password"];
                 }
                 if (Request.Params["persistent"] != null)
                 {
                     isPersistent = Convert.ToBoolean(Request.Params["persistent"]);
                 }
                 if (!string.IsNullOrWhiteSpace(userName) && !string.IsNullOrWhiteSpace(password))
                 {
                     credentials = new Telerik.Sitefinity.Security.Credentials();
                     credentials.UserName = userName;
                     credentials.Password = password;
                     credentials.MembershipProvider = ConfigurationManager.AppSettings["membershipProvider"];
                     credentials.Persistent = isPersistent;
                 }
                 if (credentials == null)
                 {
                     //redirect to login page
                     RedirectToLoginPage();
                 }
                 try
                 {
                     UserLoggingReason reason = userService.AuthenticateUser(credentials);
                     if (reason == UserLoggingReason.Success)
                     {
                         string destPage = ResolveUrl(landingPage);
                         Response.Redirect(destPage, false);
                     }
                     else
                     {
                         //redirect to login page
                         RedirectToLoginPage();
                     }
                 }
                 catch (Exception ex)
                 {
                     Response.Write(ex.Message);
                 }
             }

    Can this be ok?
    Thanks
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    02 May 2011
    Link to this post
    Hi Paolo,

    I would prefer using a call to the web service directly, but since this works for you it is fine.

    All the best,
    Ivan Dimitrov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  8. Paolo
    Paolo avatar
    147 posts
    Registered:
    11 Jun 2009
    02 May 2011
    Link to this post
    Ivan I use this since I redirect the users to a landing page dipending on user's role...
    It's easier for me of doing so...
    Thanks
8 posts, 0 answered