Causes and countermeasures for logging out of Excel when linking from Excel
When I step on a link from Word or Excel, for some reason I am taken to the login screen. We have also experienced this problem with learningBOX, but the problem has been resolved in version 2.8.9. We are now disclosing the cause and countermeasure for this problem, in case other systems may also be suffering from the same problem. Table of Contents 1. symptoms 2. causes 2. countermeasures 3. why was it discovered in the first place? 4. are all the web apps out there coping with it? Symptom While logged in to a system, opening a URL in the system from Word or Excel causes a transition to the login screen. Since the user is already logged in, we would like the user to open the URL in the system directly. Cause When a user clicks on a link in Word or Excel, Word or Excel sends a request to the link address, and since Word or Excel is not logged in to the linked site, it receives a response that redirects to the login page. The URL of the redirected page is the URL of the web browser. This redirect URL is passed to the web browser, which causes a transition to the login page. Countermeasure When a request for the page after login is received from Word or Excel, do not perform redirect processing. By doing so, the specified URL is passed to the web browser as it is, and the post-login page can be opened. In the figure above, you can change the process in point (2). If you are using PHP, you can use the following code to handle this issue. exit may have side effects, so please terminate the process in accordance with your framework. Returning an empty document with a status code of 200 is usually OK. How was it discovered in the first place? One of our customers distributes URLs for educational materials via Excel, and for some reason, when the customer steps on the link, they are redirected to a login screen. Since there is no special exception handling only when the link is opened from Excel, we investigated the cause by referring to the web server logs, etc., and found that the problem was caused by a strange behavior of Office. Are the web apps out there coping? As of January 14, 2020, Gmail and Slack have been addressed, but there are many services that everyone knows about that have not been addressed. This is not so much a problem on the web application side as it is a problem with the behavior of Office, but it can be easily handled using the method described above, so please consider taking action.