Viewers
Viewers copied to clipboard
[Bug] 401 Unauthorised Error because of an old auth token used during coming back from study to studies list.
Describe the Bug
If we use authentication, such as Keycloak, with OHIF, we encounter an issue when returning from the study to the study list. Instead of returning, we encounter the 401 Error and are redirected to the /not found server URL. This happens if we spend with study more than 5 minutes (token refresh time).
Based on our investigation, the application uses an outdated token. It works as expected if we manually copy the latest refreshed token from the network tab and make a network call.
Steps to Reproduce
- Use OHIF with authentication.
- Go to the study page
- Stay on a study page longer than the token refresh time.
- Go to the studies list.
The current behavior
When we go to the studies list after a time longer than the token refresh cycle, we get the 401 Error.
The expected behavior
The OHIF application should update the token in the request properly, and we should be able to access the studies list without any issues.
OS
macOS 14.5 (23F79)
Node version
v18.20.3
Browser
125.0.6422.113 (Official Build) (arm64)
The current state of OHIF utilizes the Implicit Flow. I have a plan to migrate our authentication to the Authorization Code with Refresh Token flow, allowing a refresh token to be used for maintaining the signed-in state.
Thanks, @sedghi, for picking this up.
related #4101
Fixed here https://github.com/OHIF/Viewers/pull/4234
We released OHIF 3.9 which address this issue