-
-
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
[Proposal/Discussion] New Credentials Issuers #96
Comments
I've got a headers issuer started at https://github.com/zikes/oathkeeper/tree/issuer-header/proxy with a passing test, however I still need to implement incoming header scrubbing and fill in more complex test cases. Let me know if you feel like that's on the right track. |
That's a pretty cool idea! I think you can build and cache templates so it shouldn't be too straining on performance. I think the Go template syntax needs getting used to but it's a pretty good place for it. I'd love to see a PR! |
@arekkas Some good news and bad news about the Go templating: the good news is that it turns out you can access maps via e.g. Currently my fix for this is to use a Would it be possible to change the |
I went ahead and implemented the map conversion method, in favor of having a better interface to present to the users. If |
|
How about |
I think I've worked out a FuncMap function that keeps it fairly clean and simple: https://play.golang.org/p/SyzsYJnaepW I was mostly worried about having to create a complex key lookup system that mimics what |
I would like to see two new Issuer types: Headers and Cookies.
Headers
As a baseline proposal for Headers, I'd like to start with Go
text/template
based configuration and proceed from there. An example rule might look like this, with the template root object being theproxy.AuthenticationSession
:Some concerns I have with the above would be the performance and unnecessary complexity of
text/template
. The same might be accomplished with aSprintf
, but with the open-ended nature of theExtra
map field of theAuthenticationSession
struct, I can think of no good way to ensure all map fields are passed intoSprintf
reliably. This assumes that theoauth2_introspection
Authenticator is eventually extended to allow for "extension" fields for arbitrary introspection data (which I would also love to see).Cookies
Using
text/template
as well for the same reasons as above:Security Concerns
Baseline security would require that the above Headers and Cookies are stripped from incoming requests to the specified upstream, to prevent someone being able to "log in" by running a simple
curl -H "X-User: admin" http://example.com
Other Implementations
Kong provides upstream header data in its gateway service, however the headers are fixed: https://docs.konghq.com/plugins/oauth2-authentication/#upstream-headers
This would certainly help with performance, but I think it would be unnecessarily restrictive when considering that OAuth2 introspection could allow for a great deal more upstream context, and that some out-of-the-box applications may have specific requirements for receiving authentication information. I think a good middle ground would be to have a set of default headers which would be used if
config
is left blank, making the rules simpler and easier to write in many cases.It's my understanding that AWS API Gateway has a similar feature, but I've been unable to locate the documentation for it. If anyone could link the relevant docs here for review that would be great.
The text was updated successfully, but these errors were encountered: