AUTHOR: Marin Bratanov
DATE POSTED: July 13, 2018
AsyncUpload not working with WebSeal SSO.
After we select the file to upload, the control shows the file name with a yellow flashing icon next to it and never completes the load of the file. In our browser's developer tools we see an error "Invalid character" (IE) or "Unexpected token <" (Chrome) related to the webresource.axd access which is thrown by JSON.parse().
WebSeal adds a cookie script to responses with Content-Type like text/html, something like:
More information on the matter: https://www.ibm.com/developerworks/tivoli/library/t-ajaxtam/index.html.
RadAsyncUpload uses Content-Type set to text/html for reponses while uploading files. File chunks that are not the last piece of the file receive only "next" in the response, and the last chunk (it can be the only chunk if the file is small enough or chunk upload is disabled), expects a JSON literal, something like:
So, after WebSeal adds the script, you will get something like the following which will cause an exception when fed to JSON.parse():
The general solution is to make sure that the response of the Telerik.Web.UI.WebResource.axd handler is not modified by WebSeal as such tampering can break other controls and features as well.
If this is not possible with WebSeal, there are two other options that you can look into:
Note that both of these solutions and issues arising from them are not supported by Telerik UI for ASP.NET AJAX.