Load-On-Demand: 'Authentication Failed'

13 posts, 0 answers
  1. Brad
    Brad avatar
    39 posts
    Member since:
    Aug 2010

    Posted 13 Oct 2010 Link to this post

    I have a RadComboBox following the Load-on-demand PageMethod example. http://demos.telerik.com/aspnet-ajax/combobox/examples/populatingwithdata/autocompletesql/defaultcs.aspx

    I am getting an alert with the message 'Authentication Failed' when I click the drop down. The RadComboBox happens to be in a RadGrid and I tried calling the same method on the RadGrid DataItemBound event and the method completed successfully (removing any question of database connectivity issues).

    <telerik:RadComboBox ID="uxService" runat="server" DropDownWidth="175px" EmptyMessage="Service:" Height="150px" Width="100px" EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true" OnClientBlur="dropDownBlur">
       <WebServiceSettings Method="GetServices" Path="TimeCard.ascx" />
    </telerik:RadComboBox>

    [WebMethod]
    public static RadComboBoxData GetServices(RadComboBoxContext context)
    {
        DataView data = Website.BlueSkyFactory.Time.GetServices(context.Text + "%");
        RadComboBoxData serviceData = new RadComboBoxData();
        int itemOffset = context.NumberOfItems;
        int endOffset = Math.Min(itemOffset + ItemsPerRequest, data.Count);
        serviceData.EndOfItems = endOffset == data.Count;
        List<RadComboBoxItemData> result = new List<RadComboBoxItemData>(endOffset - itemOffset);
        RadComboBoxItemData itemData;
        for (int i = itemOffset; i < endOffset; i++)
        {
            itemData = new RadComboBoxItemData();
            itemData.Text = data[i]["FriendlyName"].ToString();
            itemData.Value = data[i]["ServiceId"].ToString();
            result.Add(itemData);
        }
        serviceData.Message = GetStatusMessage(endOffset, data.Count);
        serviceData.Items = result.ToArray();
        return serviceData;
    }

    Please advise.
  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 14 Oct 2010 Link to this post

    Hello Brad,

    Please put a debugger breakpoint in the GetServices method and step through all of the lines to see whether an exception is thrown.

    Greetings,
    Simon
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Brad
    Brad avatar
    39 posts
    Member since:
    Aug 2010

    Posted 14 Oct 2010 Link to this post

    I did this and as I stated, the initial run through it works. When I click the dropdown, however, the breakpoint is not hit. I have worked around the issue for now by using the ItemsRequested event, but I think I'd rather avoid the post-back.
  5. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 19 Oct 2010 Link to this post

    Hi Brad,

    Searching in Google for 'authentication failed page method' yields many results, one of which suggests enabling of the Session in the WebMethod attribute, e.g.
    [WebMethod(Session=true)]

    Does this help?

    All the best,
    Simon
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Jason Marshall
    Jason Marshall avatar
    10 posts
    Member since:
    Apr 2010

    Posted 17 Feb 2011 Link to this post

    I have same issue. I am using Forms Auth, and my session timeout is set at 120 minutes. However after 15 minutes of inactivity, the AJAX load-on-demain radcombobox gives me a messagebox: 'Authentication Failed' when you type something in it.

    I see how you can catch this error, but i want to AVOID it altogether.
    I tried to doing a session keep-alive to fire every 5 minutes, but this still occurs. Please help! How can I get the load-on-demand to respect session timeout? 
    thanks
    Jason
  7. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 01 Mar 2011 Link to this post

    Hello Jason Marshall,

    Can you reproduce this each time in a new and simple project? Additionally, what is the type of Load On Demand you are using - server-side or WebService?

    All the best,
    Simon
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  8. Eric
    Eric avatar
    31 posts
    Member since:
    Mar 2008

    Posted 16 Mar 2011 Link to this post

    I was able to fix this problem by adding the   [ScriptService]  tag to the class.
  9. Dan
    Dan avatar
    15 posts
    Member since:
    Mar 2006

    Posted 07 Dec 2011 Link to this post

    I am getting the same "Authentication failed." error while using the control via a webservice.  The webservice class is designated with [ScriptService] and the method has the Session=true attribute set as well.  It is a fairly complicated session scenario, and I think that an expired session is the source of that error, but I was wondering how one might go about catching that error and redirecting the user.  Thanks for your help.
  10. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 12 Dec 2011 Link to this post

    Hello Daniel,

    Do you have authentication and authorization enabled in your web site? If yes, please verify that you have granted proper access to the web service.

    All the best,
    Simon
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  11. Dan
    Dan avatar
    15 posts
    Member since:
    Mar 2006

    Posted 12 Dec 2011 Link to this post

    Yes, I have the authorization and authentication set up correctly.  I should have said that I only get this issue intermittently, so that is why I wanted to know how to catch that error.
  12. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 12 Dec 2011 Link to this post

    Hello Daniel,

    The most straightforward way to troubleshoot such issues is to inspect the IIS logs for more details on the exception and the error code.

    Kind regards,
    Simon
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  13. Nazme
    Nazme avatar
    2 posts
    Member since:
    Feb 2013

    Posted 16 Sep 2013 Link to this post

    Hi Simon,

    I have the same issue which I get intermittently. I have set authentication and authorization in web.config. Still I get an alert with “authentication failed”. I could not solve this problem for more than 3 weeks. Could you please help me? Thanks.

    Nazme

  14. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 19 Sep 2013 Link to this post

    Hello Nazme,

    I noticed that you had submitted a support ticket regarding the same issue. Therefore, I would suggest you to continue the conversation in the other ticket, in order to avoid duplication.

    Regards,
    Nencho
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017