xmlhttprequest - XHR requests fail when an ADFS authenticated session expires -


We have a site that relies on federated authentication using Active Directory Federation Services (ADFS) and WSFAducationEntification Module.

A set of XHR requests in this site has also been removed at user interaction. A special example is a drop-down menu that lets the user impersonate other users. Another site-wide search page has a mask functionality. The problem is that the session expires when the user remains idle on the page for some time. In general HTTP requests, when the user clicks on the link, for example, this is not a problem. At the end of the session, the user is redirected to the STS and the user is never taken into account - it is very fast.

But XHR requests fail. There is a real error message in the console:

  XMLHttpRequest https: //adfs.contoso.com/adfs/ls/ ... can not load 'Access control-permission-origin' header requested The source is present on the resource 'https://www.example.com' therefore the entry is not allowed  

It seems that the XHR request can not redirect to the STS and return later It can return the party as if it happens with a regular HTTP request because it has a CORS problem is.

It naturally relies on all the elements on the page, especially Javascript. Its the only way for the user to refresh the page, when the problem occurs.

What will be the correct way to solve it?

Add it to the web config in the ADFS ls folder or if you are using an ADFS proxy Are related to.

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Configuration & gt; & Lt; System.webServer & gt; & Lt; HttpProtocol & gt; & Lt; CustomHeaders & gt; & Lt; Add name = "access-control-permission-origin" value = "*" /> & Lt; / CustomHeaders & gt; & Lt; / HttpProtocol & gt; & Lt; /system.webServer> & Lt; / Configuration & gt;  

Ref:


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -