Open andrewweston opened 2 years ago
The gRPC middleware httpRequest method transforms selected grpc metadata keys to http headers. The only metadata items translated are "authorization" and those with keys beginning with "x-" (see https://github.com/ory/oathkeeper/blob/master/middleware/grpc_middleware.go#L33-L41).
This means the Cookie header is not set and the cookie_session authenticator fails.
cookie_session
No response
config.yaml: serve: proxy: port: 4455 api: port: 4456 access_rules: repositories: - file://rules.yaml authenticators: cookie_session: enabled: true config: check_session_url: https://<project-slug>.projects.oryapis.com/sessions preserve_path: true force_method: GET authorizers: allow: enabled: true
rules.yaml:
- id: some-id match: authority: localhost:50001 full_method: hello.helloService/Hello authenticators: - handler: cookie_session
v0.40.1-0.20220923195049-ae7b65b54090 (latest commit)
macOS
Making the following change to https://github.com/ory/oathkeeper/blob/master/middleware/grpc_middleware.go#L36
// if k == "authorization" || strings.HasPrefix(k, "x-") { if k == "authorization" || k == "cookie" || strings.HasPrefix(k, "x-") {
leads to a successful request
Thank you for the report! Unfortuantely, the gRPC middleware is very experimental right now :(
Preflight checklist
Describe the bug
The gRPC middleware httpRequest method transforms selected grpc metadata keys to http headers. The only metadata items translated are "authorization" and those with keys beginning with "x-" (see https://github.com/ory/oathkeeper/blob/master/middleware/grpc_middleware.go#L33-L41).
This means the Cookie header is not set and the
cookie_session
authenticator fails.Reproducing the bug
cookie_session
authenticator (see below)Relevant log output
No response
Relevant configuration
rules.yaml:
Version
v0.40.1-0.20220923195049-ae7b65b54090 (latest commit)
On which operating system are you observing this issue?
macOS
In which environment are you deploying?
No response
Additional Context
Making the following change to https://github.com/ory/oathkeeper/blob/master/middleware/grpc_middleware.go#L36
leads to a successful request