Allow IdP initiated SAML login with session containing expired token.#59686
Conversation
|
Pinging @elastic/kibana-security (Team:Security) |
b6b7545 to
ca014a7
Compare
There was a problem hiding this comment.
note: we can keep this if we decide to fix the issue without ES part in elastic/elasticsearch#53323.
ca014a7 to
af4e956
Compare
af4e956 to
a32f60f
Compare
legrego
left a comment
There was a problem hiding this comment.
LGTM! Tested locally, works great.
| this.logger.debug(`Failed to invalidate refresh token: ${err.message}`); | ||
| // We don't re-throw the error here to have a chance to invalidate access token if it's provided. | ||
| invalidationError = err; | ||
|
|
There was a problem hiding this comment.
At some point (not now), it might make sense to consolidate the error handling logic for the access and refresh tokens, since they appear nearly identical. I fear these will accidentally diverge at some point, and we'll have another subtle auth bug on our hands
There was a problem hiding this comment.
Totally agree, every time I change this code I stare at it and want to unify, but always defer for one reason or another 🙈
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
1 similar comment
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Calm down, @kibanamachine, I know and told you the reason in #59686 (comment) already! |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
10 similar comments
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
As in proposed in #59629 in this PR we're trying to leverage existing session during IdP initiated SAML login even if it contains expired access token.
Notable changes:
404errors that Elasticsearch returns when it tries to invalidate non-existent tokens in exactly the same way as we'd treat404response (see Fix responses for the token APIs elasticsearch#54532 (comment) for details)How to test:
Note: You may want to close browser tab (not window) after step 1 so that Kibana doesn't automatically log you out.
Blocked by: elastic/elasticsearch#53323Fixes: #59629
"Release Note: previously user couldn't log in with SAML Identity Provider Initiated flow (e.g. from Okta Dashboard) if they already had an existing, but expired session. Now it should be possible."