This is a migrated thread and some comments may be shown as answers.

Authentification when working with web service.

1 Answer 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dmitriy
Top achievements
Rank 1
Dmitriy asked on 02 Jul 2012, 12:09 PM
To get data from remote web-service for my grid I have to login and get sessionID.
Ok I can pass this sessionID 
read: {
url: someurl,
                                    data: {
                                        action: "GetList",
                                        sessionID: Auth.sessionID,
                                    }, 
                                    type: "POST",
                                },

The problem is that this  sessionID have rather short lifetime. In other words it can expire while a user work with my grid.
So I have to relogin sometimes(if web-servers tells me "session is expired").

Is there an elegant way to intercept such auth error from my server and resend failed call?

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 05 Jul 2012, 07:56 AM
Hello Dmitriy,

The dataSource has an error event which will fire when an error occurs during the Ajax request. You could hook up to this event and notify the user about the problem or resend the failed call (invoke dataSource.read()). If there are any pending CRUD operations they can be submitted through the sync() method.

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Dmitriy
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or