Web service authentication

5 posts, 0 answers
  1. Mike
    Mike avatar
    8 posts
    Member since:
    Jul 2015

    Posted 11 Feb Link to this post

    Hello,

    I made an ASP.NET page that uses a RadScheduler with client-side binding.

    User access to the application is authenticated by a classical login form based on ASP.NET Membership.

    Everything works fine except for an authentication issue that periodically occurs.

    The following is an example to illustrate the scenario in which the issue is encountered:

    • a user goes to the RadScheduler page
    • they leave the page open but don't use the application for some hours (and during this time, the user session expires)
    • if the user performs a navigation command on the scheduler (for exampe: click on "next week"), the browser displays a modal dialog box in which authentication is requested, with login and password fields
    • if the user inputs their credentials and clicks "ok", another alert box says "Authentication failed" and so on
    • at this point the user is stuck on this page and is forced to close the browser tab or entire browser window.

     My question is: what can I do in order to make user credentials be accepted by the server?

    I already tried with this in web.config:

    <system.web.extensions>

    <scripting>

    <webServices>

    <!-- Allows for ajax.net user authentication -->

    <authenticationService enabled="true" requireSSL="false" />

    </webServices>

    </scripting>

    </system.web.extensions> 

    but nothing changed.

     

    Any suggestion would be appreciated.

    Thanks in advance

    Regards

    Mike

     

     

  2. Plamen
    Admin
    Plamen avatar
    2730 posts

    Posted 16 Feb Link to this post

    Hello,

    I have tested the scenario but could not replicate the issue at my side. From the explanation it is not quite clear which request is failing the one for appointments or the one for resources. You may try to use some of the recommended setting from this help topic

    Hope this will help you solve the issue.

    Regards,
    Plamen
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mike
    Mike avatar
    8 posts
    Member since:
    Jul 2015

    Posted 23 Feb in reply to Plamen Link to this post

    Hi Plamen

    thanks for your feedback, and please excuse me for my late replying.

    As a general info, I want to specify that I developed this scheduler page without using the AdvancedForm feature. I rather developed an AdvancedForm emulation by using a modal RadWindow, so that I have really total client-side control over the appointment form features.

    Regarding the issue:
    I had already included in my application the setup and code from the link that you provided. I did this in order to fix the error 401 issue (and I was successful in that).

    The problem here is different. In order to clarify where the error occurs, I did a debugging session of my JavaScript code and what happens is as follows:

    - In browser tab 1, I open the app's home page

    - In browser tab 2, I open the app's scheduler page, which shows appointments for the current week

    - In browser tab 1, I perform the logout from the app

    - In browser tab 2, I perform one scheduler navigation command (for example: click on previous week button)

    - An alert box showing userid and password fields requires a new authentication. This alert box is something built-in into the browser, not controlled by my app. No authenthication is really possible here, as it always says that credentials entered are not correct.

    Before the alert box is shown, the browser debugger showed me that script execution entered the OnClientAppointmentsPopulating event, and did not enter the OnClientResourcesPopulating event (I put a "debugger" statement in both; I purposedly created the OnClientResourcesPopulating event, because it is not required by my code as resources populating is performed by code-behind on page load). The alert was shown right after entering the OnClientRequestFailed event.

    In my example I forced the user disconnection, but the same happens (as I wrote in the original post) if some time elapses before user performs any command on the scheduler, and user logon session expires.

    What I need is to understand how to make the browser authentication work, as it currently does not accept any user id / password, and keeps on saying "Authentication failed".

     

    Thanks

    Regards

    Mike

  5. Plamen
    Admin
    Plamen avatar
    2730 posts

    Posted 25 Feb Link to this post

    Hi,

    Thank you for getting back to us.

    In this scenario RadScheduler is using a simple web service call to get the appointments. That is why the error that you are getting seems like a common error that would occur when some data is to be server from the service without authentication. In such case I would rather recommend you to refer to so some general ASP. NET forum where similar issues have been discussed as the forum threads below:
    http://stackoverflow.com/questions/17511838/asp-net-webservice-secure-call-the-webservice-with-jquery-ajax

    https://msdn.microsoft.com/en-us/library/bb398896.aspx

    http://forums.asp.net/t/1975897.aspx?jquery+ajax+calls+to+asp+net+web+methods+authentication+error+

    If the issue is still somehow different for RadScheduler than a simple call please let us know so we could try to inspect the issue and be more helpful.

    Regards,
    Plamen
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  6. Mike
    Mike avatar
    8 posts
    Member since:
    Jul 2015

    Posted 26 Feb in reply to Plamen Link to this post

    Hi Plamen,

    thank you for your feedback.

    In fact, the scenario that you described is the right one that is in place.

    I will examine the links you provided and get back with the outcome.

    Regards

    Mike

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017