Kendo UI and JWT

2 posts, 0 answers
  1. danny
    danny avatar
    1 posts
    Member since:
    Jan 2015

    Posted 02 Feb 2015 Link to this post

    I am developing single page application with angularJs, the application uses JWT Authorization headers to authenticate with my MVC web API. I recently integrated Kendo into the application but i noticed that my AngularJs request interceptor is not able to intercept calls generated from kendo grid .

    Is there a common place where i can intercept http requests initiated from Kendo grid and other kendo components . so that i can add Authorization Header ?

    here is my inerceptor
    ['$httpProvider', function ($httpProvider) { $httpProvider.interceptors.push('authInterceptorService'); }]

    function addToken(config) {

                var token = tokenStoreFactory.getToken();
                if (token) {
                    config.headers = config.headers || {};
                    config.headers['Authorization'] = 'Bearer ' + token;
                return config;

  2. Petur Subev
    Petur Subev avatar
    1882 posts

    Posted 05 Feb 2015 Link to this post

    Hello Daniel,

    Kendo Grid uses jQuery's Ajax method to performs XHR requests. And all the settings that are passed to the jQuery ajax method should be defined on the configuration (same goes for the Update/Create/Destroy operations).

    Here is an example how you can configure your DataSource to add extra headers with information (via the beforeSend event).

    Kind Regards,
    Petur Subev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top