-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle access tokens that expire after authentication stage #104893
Comments
Pinging @elastic/kibana-security (Team:Security) |
The first option sounds more holistic to me, but I think it'd be worth drawing a diagram first to make sure we understand what the flow would look like, and how we would handle all possible outcomes at each step of the request lifecycle. |
Yep, it's a good point, there can be a plenty of different "sub-flows" and outcomes. |
Even though the issue isn't new, we see more and more customers are hit by it and it may escalate pretty quickly, especially since Kibana in Cloud relies on token-based authentication by default (via SAML). That's why we'd like to investigate possible solutions and understand required effort as early as possible. I met with @mshustov earlier today to discuss the options we have. Even though the first proposal from #104893 (comment) is definitely not the simplest change, it still sounds like the most reasonable one: introduce a new extension point in the Core that would allow security plugin to try to handle At this point it's not completely clear what the ideal API would look like, but I'll try to outline what we know so far: When should we try to handle
|
The authentication stage is the only stage in a request lifecycle when Kibana can properly handle expired access tokens either by refreshing them or re-initiating authentication. This approach served us reasonably well in the past, but we can do better.
There are cases when Kibana needs more time to process user request and hence re-use the access token multiple times. The longer access token is used after authentication stage the higher the chance that it can expire in the middle of request processing. If this happens Kibana may return 401 error that will trigger logout (see the flow №3 in the
Current flows
section).There are a plenty of ways to tackle this, for example:
scoped
clients, internal clients don't need this functionality.I'm leaning towards the first option, but any other ideas and suggestions are welcome.
The diagramming tool: https://mermaid.live/
Current flows
Source
Source
Source
Proposed flows
Source
Source
The text was updated successfully, but these errors were encountered: