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

Forums / Bugs & Issues / Problem when calling the User Service to validate a user

Problem when calling the User Service to validate a user

4 posts, 0 answered
  1. Paolo
    Paolo avatar
    147 posts
    Registered:
    11 Jun 2009
    26 Apr 2011
    Link to this post
    Hello,
    i'm tring  to validate a user from a page calling the User Webservice but I got troubles....
    here's what's happening  :

    protected void Page_Load(object sender, EventArgs e)
          {
              Telerik.Sitefinity.Security.Web.Services.Users users = new Telerik.Sitefinity.Security.Web.Services.Users();
     
              Telerik.Sitefinity.Security.Credentials credentials = new Telerik.Sitefinity.Security.Credentials();
     
              credentials.UserName = "admin";
              credentials.Password = "1234567890";
              credentials.MembershipProvider = "IFProvider";
               
              //  credentials.Persistent = true;
     
              try
              {
                  UserLoggingReason resaon = users.AuthenticateUser(credentials);
              }
              catch (Exception ex)
              {
                  int i = 0; //Got exception pasted below
     
              }
     
          }

       at Telerik.Sitefinity.Security.Model.User.get_ProviderName()
       at Telerik.Sitefinity.Security.SecurityManager.AuthenticateUser(User user, UserManager manager, Boolean persistent)
       at Telerik.Sitefinity.Security.SecurityManager.AuthenticateUser(String membershipProviderName, String userName, String password, Boolean persistent, User& user)
       at Telerik.Sitefinity.Security.SecurityManager.AuthenticateUser(Credentials credentials)
       at Telerik.Sitefinity.Security.Web.Services.Users.AuthenticateUser(Credentials credentials)
       at SitefinityWebApp.IDEAPassThrought.Page_Load(Object sender, EventArgs e) in C:\Projects\SF_Credenziali\IDEAPassThrought.aspx.cs:line 27

    I've noticed that in my implementation of IFProvider (the class that inherits from MembershipDataProvider) if I check for the Provider name I got an exception...

    I've also tried using :

    public IFProvider()
           {
               if (System.Web.HttpContext.Current.Session != null && System.Web.HttpContext.Current.Session["ListaUtenti"] != null)
               {
                   ListaUtenti = System.Web.HttpContext.Current.Session["ListaUtenti"] as List<User>;
     
               }
             
               providerDecorator = new EmptyDecorator();
               providerDecorator.Initialize("IFProvider", null, typeof(IFProvider));
           }

    can you please help me?
    Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    28 Apr 2011
    Link to this post
    Hello Paolo,

    You should make a web request. You can use

    var wRequest = new Sys.Net.WebRequest();


    Regards,
    Ivan Dimitrov
    the Telerik team

  3. Neha
    Neha avatar
    7 posts
    Registered:
    21 May 2013
    26 Nov 2013 in reply to Ivan Dimitrov
    Link to this post
    how can i authenticate the sitefinity service call using web-request ?

    i am facing the issue kind of issue as above i.e. unable to validate users while web service call?

    thanks in advance!
    regards,
    Neha
  4. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    29 Nov 2016
    27 Nov 2013
    Link to this post
    Hello Neha,

    You could check the following blog posts:
    RESTful services in Sitefinity
    Claims Authentication and Designing

    I hope the information is useful.

    Regards,
    Svetoslav Manchev
    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 Public Issue Tracking system and vote to affect the priority of the items
4 posts, 0 answered