asp.net mvc - Kendo DataSource read() fails because of redirection for authentication -
i have mvc website uses kendo controls in many of views.
the code -
view
@(html.kendo().multiselectfor(model => model.certificateids) .htmlattributes(new { style = "width: 140%" }) .datatextfield("certificatename") .datavaluefield("certificateid") .placeholder("select certificates") .datasource(source => { source.read(read => { read.action("getcertificates", "account"); }); }) )
controller
[httpget] [outputcache(duration = int.maxvalue, location = outputcachelocation.any)] public jsonresult getcertificates() { return json(_accountsmanager.getallcertificates(), jsonrequestbehavior.allowget); }
the problem - read.action() should certificates me, , 9 out of 10 times does. every , then, when session needs replenished application redirects call https://login.windows.net/ (i using azure ad authentication). redirection causes whole read action fail , no data loaded in dropdown.
the exact error
xmlhttprequest cannot load https://login.windows.net/72...47/oauth2/autho…rm...jc1. no 'access-control-allow-origin' header present on requested resource. origin 'https://xyz-test.cloudapp.net' therefore not allowed access.
i know type of error happens when cors issue, dont think 1 that. similar redirections authentication happen in other parts of website , work fine.