quaint-exabyte-70991
07/19/2023, 1:19 PMbrave-pillow-3744
08/03/2023, 9:48 AM{
"<https://example.com/user_email>": "<mailto:sanket@example.com|sanket@example.com>",
}
• In the request headers in the ory oath keeper logs, we can see the token but is not parsed.
authorization:["Bearer <token>"]
• Currently, the JWT flow with the oath keeper is working fine. Is there any way to pass the parse JWT token to the remote_json authorizers payload?
Any ideas/pointers will be very helpful to debug the issue.steep-lamp-91158
steep-lamp-91158
brave-pillow-3744
08/03/2023, 11:15 AMshy-beach-55709
08/03/2023, 7:23 PM{{ print .Extra.email }}
we didn't need to use mutators nor anything.
In the logs you won't see the jwt being parsed, it'll appear as Authorization: Bearer YOURTOKEN
. Also, note that the logs in keto won't show the payload being received to authorize (or at least, we didn't manage to show them) .brave-pillow-3744
08/04/2023, 5:44 AM<https://example.com/user_email>
}}
• Golang only supports backquotes and double quotes.
For more context on the oath keeper config:
In JWT, The email is in the format:
{
"<https://example.com/user_email>": "<mailto:sanket@example.com|sanket@example.com>",
}
In the oathkeeper.yml config:
authorizers:
remote_json:
enabled: true
config:
remote: <https://api.example.com/relation-tuples/check>
payload: |
{
"subject_id": "{{ index .Extra `<https://example.com/user_email>` }}"
}
And in access-rules.yml :
authorizer:
handler: remote_json
config:
remote: <https://api.example.com/relation-tuples/check>
payload: |
{
"namespace": "default-namespace",
"object": "product",
"relation": "read",
"subject_id": "{{ index .Extra `<https://example.com/user_email>` }}"
}