bug: Openid-connect plugin use_jwks
breaks Authorization headers when bearer_only is true
#10669
Labels
bug
Something isn't working
Current Behavior
When using the openid-connect plugin with
bearer_only
as false, the plugin will normally authenticate both requests with the session cookie and requests with an explicitAuthorization: Bearer
header. This is very useful to allow both browser based and programmatic access to some resource.E.g.
However, if you use jwks instead of explicitly setting the public key, requests with a proper
Authorization: Bearer
header still get the302 Found
response.Expected Behavior
Authorization headers should get checked the same way whether you are manually setting a public key or using jwks.
Error Logs
No response
Steps to Reproduce
Create a route with an openid-connect configuration like so
curl https://example.com -H "Authorization: Bearer $TOKEN"
will return a an HTML 302 error page.
I believe the issue is caused by not checking for
use_jwks
on this lineEnvironment
apisix version
): 3.7.0uname -a
): Linuxopenresty -V
ornginx -V
): openresty/1.21.4.2curl http://127.0.0.1:9090/v1/server_info
): N/A (standalone mode)The text was updated successfully, but these errors were encountered: