-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat: support post_logout_redirect_uri config in openid-connect plugin #6455
Conversation
@@ -47,6 +47,7 @@ The OAuth 2 / Open ID Connect(OIDC) plugin provides authentication and introspec | |||
| realm | string | optional | "apisix" | | Realm used for the authentication | | |||
| bearer_only | boolean | optional | false | | Setting this `true` will check for the authorization header in the request with a bearer token | | |||
| logout_path | string | optional | "/logout" | | | | |||
| post_logout_redirect_uri | string | optional | | | URL want to redirect when request logout_path |
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.
please align the table
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.
OK. Let me fix it.
t/plugin/openid-connect.t
Outdated
"uri": "/*" | ||
}]], | ||
[[{ | ||
"node": { |
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.
We don't need to check the response data of this request, right?
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 we should check the response data of this request like other route-creating tests.
Why we don't need to check the response?
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.
Yes, we check the response status code but not the data. The data is mostly an echo of the input.
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.
Let me remove it.
t/plugin/openid-connect.t
Outdated
end | ||
end | ||
|
||
-- Get the final URI out of the Location response header. This should be the original URI that was requested. |
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.
The similar Lua snipper is repeated in multiple tests. Could we refactor it?
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.
Hi, @spacewander.
The similar Lua snipper is repeated in multiple tests.
Yes, they are repeated. But I have no idea about refactoring it, can you give me some examples or docs?
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.
Line 30 in acbb111
my $extra_init_by_lua = <<_EOC_; |
You can define helper functions in extra_init_by_lua
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.
Fixed. Please review it again.
What this PR does / why we need it:
Hi, this PR is used to support post_logout_redirect_uri config in openid-connect plugin.
So that we can redirect the uri when request the logout path of openid-connect plugin.
Fix: #6345, #6362
Since the lua-resty-openidc has support post_logout_redirect_uri already, we can just add post_logout_redirect_uri config in our plugin.
Refer: https://github.com/zmartzone/lua-resty-openidc/blob/3aac462f8206b8553cd1f34bb99b1788efbc2140/lib/resty/openidc.lua#L1331-L1339
Pre-submission checklist: