Skip to content

fix: add redirect_after_logout_uri for ODIC that do not have an end_session_endpoint#10653

Merged
juststillthinking merged 13 commits into
apache:masterfrom
luoluoyuyu:ODIC_redirect_after_logout
Dec 25, 2023
Merged

fix: add redirect_after_logout_uri for ODIC that do not have an end_session_endpoint#10653
juststillthinking merged 13 commits into
apache:masterfrom
luoluoyuyu:ODIC_redirect_after_logout

Conversation

@luoluoyuyu

@luoluoyuyu luoluoyuyu commented Dec 15, 2023

Copy link
Copy Markdown
Member

Description

Fixes #6791

Problem Analysis

When the openid service does not support end_session_endpoint, the ODIC logout fails to redirect to post_logout_redirect_uri. this issue is caused by the OpenID standard. end_session_endpoint does not necessarily need to be implemented.

Solution

Use the redirect_after_logout_uri defined in lua-resty-openidc for redirection when the OpenID service does not support end_session_endpoint.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@Sn0rt

Sn0rt commented Dec 15, 2023

Copy link
Copy Markdown
Contributor
  1. new test for cover
  2. user doc

@luoluoyuyu

luoluoyuyu commented Dec 15, 2023

Copy link
Copy Markdown
Member Author

user doc

It's not necessary to add documentation, this PR is just to support services like Google that don't provide the end_session_endpoint configuration, and OIDC can also correctly using the post_logout_redirect_uri configuration.

@luoluoyuyu

Copy link
Copy Markdown
Member Author

Comment thread apisix/plugins/openid-connect.lua Outdated
Comment thread apisix/plugins/openid-connect.lua Outdated
Comment thread apisix/plugins/openid-connect.lua Outdated

@moonming moonming left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can not merge without test cases

Comment thread t/plugin/openid-connect.t Outdated



=== TEST 35: Check whether outh0 can redirect normally using post_logout_redirect_uri configuration

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auth0

@shreemaan-abhishek shreemaan-abhishek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great job

@juststillthinking
juststillthinking merged commit 129844c into apache:master Dec 25, 2023
@kayx23

kayx23 commented Dec 27, 2023

Copy link
Copy Markdown
Member

@luoluoyuyu a question for the below:

image

What if someone configures both post_logout_redirect_uri and redirect_after_logout_uri?

https://github.com/zmartzone/lua-resty-openidc/blob/master/tests/spec/logout_spec.lua#L264-L299

@luoluoyuyu

luoluoyuyu commented Dec 28, 2023

Copy link
Copy Markdown
Member Author

@luoluoyuyu a question for the below:

image

What if someone configures both post_logout_redirect_uri and redirect_after_logout_uri?

https://github.com/zmartzone/lua-resty-openidc/blob/master/tests/spec/logout_spec.lua#L264-L299

Hi @kayx23 'redirect_after_logout_uri' is not defined in the schema. If 'redirect_after_logout_uri' is configured, an error will occur. apisix/apisix/plugins/openid-connect.lua at master · apache/apisix (github.com)

@kayx23

kayx23 commented Jan 2, 2024

Copy link
Copy Markdown
Member

If 'redirect_after_logout_uri' is configured, an error will occur.

Not really true as previously shown.

image

However I will remove redirect_after_logout_uri from the new doc given this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: openid-connect plugin doesn't redirect after logout

6 participants