bland-finland-95044
02/26/2024, 2:39 PMchilly-king-10285
02/26/2024, 2:39 PMchilly-king-10285
02/26/2024, 2:40 PMbland-finland-95044
02/26/2024, 2:41 PMchilly-king-10285
02/26/2024, 2:41 PMchilly-king-10285
02/26/2024, 2:41 PMremote
and remote_json
, which can make HTTP POST requests to a remote endpoint for authorization decisions. For example, the remote_json
authorizer configuration might look like this: yaml # Global configuration file oathkeeper.yml authorizers: remote_json: # Set enabled to "true" to enable the authenticator, and "false" to disable the authenticator. Defaults to "false". enabled: true config: remote: <http://my-remote-authorizer/authorize> payload: | { "subject": "{{ print .Subject }}", "resource": "{{ printIndex .MatchContext.RegexpCaptureGroups 0 }}" }
(Source: [Ory Oathkeeper Documentation](https://www.ory.sh/docs/oathkeeper/pipeline/authz#remote_json-example)) In this example, the remote
field would be the URL of your Ory Network endpoint. The payload
field is a JSON object that is sent to the remote authorizer. The values in the payload are parsed from the AuthenticationSession
object. Please refer to the [Ory Oathkeeper documentation](https://www.ory.sh/docs/oathkeeper/) for more detailed information and examples.bland-finland-95044
02/26/2024, 2:43 PMchilly-king-10285
02/26/2024, 2:43 PMchilly-king-10285
02/26/2024, 2:44 PMauth_request
directive in your Nginx configuration: nginx location /protected/ { auth_request /authz; ... } location = /authz { internal; proxy_pass <http://ory-oathkeeper-api-url/decisions;> proxy_pass_request_body off; proxy_set_header Content-Length ""; proxy_set_header X-Original-URI $request_uri; }
In this example, Nginx would send a subrequest to the /decisions
endpoint of your Ory Oathkeeper API for each request to a URL under /protected/
. The X-Original-URI
header is set to the original request URI. 2. Configure Ory Oathkeeper to make authorization decisions based on these subrequests. This would involve setting up appropriate access rules in Ory Oathkeeper. An example of an access rule can be found in the provided extracts ([source](https://www.ory.sh/docs/oathkeeper/guides/proxy-websockets#configure-ory-oathkeeper-and-ory-kratos)). Please refer to the [Ory Oathkeeper documentation](https://www.ory.sh/docs/oathkeeper/) and the [Nginx documentation](https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-subrequest-authentication/) for more detailed information and examples.