-
Notifications
You must be signed in to change notification settings - Fork 360
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
Support fully both Oauth & JWT authenticator in access rule #257
Comments
I think that's quite sensible. How about extending this a bit? {
"config": {
"token_from": {
// "header_value": "x-foo-bar",
// or
// "authorization_header": "bearer/jwt/.." (bearer would be the default)
// or
// "query_parameter": "token"
}
}
} I'm not happy with the naming yet but I think it would decrease the verbosity of configuration. |
@aeneasr so basically you want to support :
Personally I would pick only header and query. I would drop scheme override after reading again: https://tools.ietf.org/html/rfc6750#section-2.1. So config could look like :
what do you think? |
Ok, makes sense. I was not super comfortable with the scheme override either. I have seen instances where I think that config looks fine! I would probably |
Maybe Yeah, I agree we should have OR. So users can define header OR query param. Not combined. Additional question would be about fallback. |
I think both
Wouldn't that break your initial use case? |
well, if user will not follow his own config there is a chance it will end up with the current issue. So let's keep in first iteration no fallback mechanism for header/query ;-) |
Ok, sounds good :) |
@aeneasr after second thought I would like to propose a small change.
Why this change? To avoid breaking change in the AccessRule API, |
Agreed, SGTM |
Is your feature request related to a problem? Please describe.
Currently, you can define Oauth2 & JWT authenticator together, however,
Authorization: Bearer
is common header scheme for those two authenticators.If you define an access rule with 2 authenticators where Oauth2 is first and a request is made with JWT, such request will be rejected as token introspection rejects presented JWT - and vice versa.
Describe the solution you'd like
Would be really nice to allow developers create an access rule which defines where to look for token header in case of authenticator JWT & Oauth or different alternative allow to specify authorization header scheme.
Example with header selection :
Example with authorization header scheme selection
Additional context
Additional considerations :
if access rules is defined with JWT/oauth authenticator with custom header but such header is not present in the request (even not in
Authorization
header) oathkeeper should reject such callif access rules is defined with JWT/oauth authenticator with custom header but in the request
Authorization
header is present, oathkeeper should validate it as it's done now with value in the Authorization header.if access rules is defined with JWT/oauth authenticator with custom authorization scheme but in the request default
Bearer
scheme is used, oathkeeper should validate requestIf access rules is defined with JWT/oauth authenticator with custom authorization scheme but in the request either defined scheme nor
Bearer
scheme is used, oathkeeper should reject such callIf scheme override option would be accepted it should have fallback to
Bearer
scheme.If header override option would be accepted it should have fallback to
Authorization
header/cc @aeneasr
Edited sample schema after discussion
The text was updated successfully, but these errors were encountered: