Hello,
I have deployed on opensearch cluster with oidc auth and we get {"statusCode":401,"error":"Unauthorized","message":"Unauthorized"} error from time to time.
From what I found, if security_authentication cookie is not present, opensearch doesn’t use OIDC auth and maybe use internal_auth which will fail because no internal user is used.
@pablo The thing is that is working as expected, it’s working with enable_ssl: false
Only problem is that sometime we get 401 error and we found out is related with missing cookie.
Could this be related with our problem?
I think it’s design flaw of Opensearch Dashboards’ client side session. Below are my guess,
It stores access token, refresh token and id token in the cookie
It refresh all tokens once the id token is about to expire, which could have very short life span, e.g. 2 minutes.
If there are simultaneous http request from the UI when the id token expires, the same cookie session are sent to backend and try to refresh tokens twice with the same refresh token, and the latter refresh request will be invalid as the its refresh token is invalidated because it’s been used by the first request.
I don’t think there is an easy solution for client-side session. Maybe there can be a tolerant-for-refresh-failure setting that can ignore the randomly happened issue.