-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Fix responses for the token APIs #54532
Changes from 12 commits
a588679
262cffa
a12ba64
24eb4b7
00efc54
406e4eb
6344a12
9e0831f
05816fe
a240c8d
fa3075a
33778d6
2ba228b
84b6296
c78cb21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -3,7 +3,7 @@ | |||
=== OpenID Connect logout API | ||||
|
||||
Submits a request to invalidate a refresh token and an access token that was | ||||
generated as a response to a call to `/_security/oidc/authenticate`. | ||||
generated as a response to a call to `/_security/oidc/authenticate`. | ||||
|
||||
[[security-api-oidc-logout-request]] | ||||
==== {api-request-title} | ||||
|
@@ -48,7 +48,7 @@ POST /_security/oidc/logout | |||
"refresh_token": "vLBPvmAB6KvwvJZr27cS" | ||||
} | ||||
-------------------------------------------------- | ||||
// TEST[catch:unauthorized] | ||||
// TEST[catch:request] | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The (expected for this test) 500 was masked by the Line 55 in d029a13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is necessary because the response changes to 200 and error now happens in the OIDC part as 500? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is necessary because we don't do the login flow so we don't have tokens to invalidate for the logout. We expect that this call would fail for that reason - but it failing with a |
||||
|
||||
The following example output of the response contains the URI pointing to the | ||||
End Session Endpoint of the OpenID Connect Provider with all the parameters of | ||||
|
@@ -60,4 +60,4 @@ the Logout Request, as HTTP GET parameters: | |||
"redirect" : "https://op-provider.org/logout?id_token_hint=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c&post_logout_redirect_uri=http%3A%2F%2Foidc-kibana.elastic.co%2Floggedout&state=lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO" | ||||
} | ||||
-------------------------------------------------- | ||||
// NOTCONSOLE | ||||
// NOTCONSOLE |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,7 @@ public void doRun() { | |
indicesWithTokens.add(securityMainIndex.aliasName()); | ||
} | ||
if (indicesWithTokens.isEmpty()) { | ||
markComplete(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good catch. |
||
return; | ||
} | ||
DeleteByQueryRequest expiredDbq = new DeleteByQueryRequest(indicesWithTokens.toArray(new String[0])); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍I think it is worth to make the behaviour of
deleteXxx
andinvalidateXxx
more consistent. It seems most of them are ignoring404
, e.g.deleteUser
. Not suggesting it for this PR, but we could potentially push for more consistency in future work. CurrentlydeleteRoleMapping
andinvalidateApiKey
are not yet with this pattern.