I am looking for guidance on how to configure authorization token management with automatic routing enabled in the Viewer SDK.
Our application sets up token refreshing using the getAccessToken callback in the Autodesk.Viewing.Initializer options, as outlined in the Getting Started Guide. Automatic routing is setup by setting the "DS_ENDPOINTS" flag. I can confirm that the access token callback is invoked on current token expiry and that the refreshed token is passed to onTokenReady. However, subsequent calls to Autodesk.Viewing.Document.load still seem to use the initial token even after it has expired instead of the new token sent in the callback. This results in 403 errors when the viewer attempts to fetch the document manifest and prevents documents from rendering successfully. Without the "DS_ENDPOINTS" feature enabled, token refreshing appears to work correctly. We are currently using version 7.110.1 of the viewer.
So far, I have attempted the following workarounds to properly handle token refreshing but none have been successful:
7.112.1Autodesk.Viewing.endpoint.HTTP_REQUEST_HEADERS.Authorizationoptions parameter of Autodesk.Viewing.Document.loadSteps to reproduce:
aps-hubs-browser-nodejsExpected result: Models are rendered correctly
Actual result: The viewer reports an error and the models do not render. A 403 error is reported in the browser console.
To close the loop, token refreshing now works correctly with automatic routing with the latest update from Autodesk in Viewer SDK version 7.114.0.