Skip to content

feat(openidc): support redis for session storage#12986

Merged
shreemaan-abhishek merged 6 commits into
apache:masterfrom
shreemaan-abhishek:chore/openidc-redis-storage
Feb 10, 2026
Merged

feat(openidc): support redis for session storage#12986
shreemaan-abhishek merged 6 commits into
apache:masterfrom
shreemaan-abhishek:chore/openidc-redis-storage

Conversation

@shreemaan-abhishek

Copy link
Copy Markdown
Contributor

Description

Fixes #12495

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)

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Feb 6, 2026
Signed-off-by: Abhishek Choudhary <[email protected]>
Signed-off-by: Abhishek Choudhary <[email protected]>
Comment thread apisix/plugins/openid-connect.lua Outdated
Comment thread apisix/plugins/openid-connect.lua
Comment thread apisix/plugins/openid-connect.lua
Comment thread docs/en/latest/plugins/openid-connect.md Outdated
Comment thread t/plugin/openid-connect-redis.t Outdated
Comment thread t/plugin/openid-connect-redis.t Outdated
Comment thread t/plugin/openid-connect-redis.t Outdated
Signed-off-by: Abhishek Choudhary <[email protected]>
Signed-off-by: Abhishek Choudhary <[email protected]>
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Feb 9, 2026
@nic-6443
nic-6443 requested review from AlinsRan and bzp2010 February 10, 2026 08:44

@bzp2010 bzp2010 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.

This is a great improvement.


The following content pertains to the OpenID Connect plugin rather than this PR.

However, in my opinion, the primary purpose of an API gateway is API proxying, handling token verification during this process, rather than acting as some kind of identity proxy.

For token verification, this is stateless. We don't need to manage sessions; verifying each request individually suffices.
The web mode (bearer_only = false), however, requires us to handle session caching in the authorization_code flow. This imposes additional work—accepting codes, exchanging tokens, establishing and maintaining sessions—forcing the gateway to manage extra stateful work.
This introduces various long-tail error scenarios and makes debugging difficult. If the sole purpose is identity proxy, perhaps create a new plugin to move the functionality or integrate with an external service to implement forward-auth.

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.

Essentially, this is just defining a new schema to expose features already supported by the library and add documentation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, the underlying lua-resty-session library is very feature rich and mature.

@shreemaan-abhishek
shreemaan-abhishek merged commit 5396af9 into apache:master Feb 10, 2026
53 checks passed
@shreemaan-abhishek
shreemaan-abhishek deleted the chore/openidc-redis-storage branch February 10, 2026 10:01
wistefan pushed a commit to wistefan/apisix that referenced this pull request Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

help request: OIDC Login Loop & Refresh Token Failures with openid-connect Plugin for SPA + API Gateway Pattern

4 participants