Open VendettaMike opened 1 year ago
This should work in 24.0.6.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. See the FAQ for more information.
Describe the bug We have been running a self-hosted version for some time and are in the process of implementing OneDrive. Our version does not run on the root URL of the host, ie DRAWIO_BASE_URL=https://hostname.servername.com/diagrams/
The OneDriveClient.js file hardcodes the redirect URL's to the root directory:
OneDriveClient.prototype.redirectUri = window.location.protocol + '//' + window.location.host + '/microsoft'; OneDriveClient.prototype.pickerRedirectUri = window.location.protocol + '//' + window.location.host + '/onedrive3.html';
This hardcoding prevents the use of running the software in a path other than the root URL.
The application was locally modified to support subdirectories, authorization was approved by the administrator, but a 500 error was thrown. It appears the Java portion is using the root URL as well. Here is a snippet from the Tomcat server:
08-Aug-2023 14:59:56.141 SEVERE [http-nio-8080-exec-109] com.mxgraph.online.AbsAuth.contactOAuthServer AUTH-SERVLET: [https://login.microsoftonline.com/common/oauth2/v2.0/token] ERROR: Server returned HTTP response code: 400 for URL: https://login.microsoftonline.com/common/oauth2/v2.0/token -> {"error":"invalid_client","error_description":"AADSTS500112: The reply address 'https://hostname.servername.com/microsoft' does not match the reply address 'https://hostname.servername.com/diagrams/microsoft' provided when requesting Authorization code.\r\nTrace ID:........}
Expected behavior The software should support OneDrive when self-hosting under non-root URL locations
Screenshots 500 Error after trying to access OneDrive:
draw.io version (In the Help->About menu of the draw.io editor):
Additional context Application has been successfully setup in Azure and authorization approved by the administrator.