This example shows a basic configuration of cookie_session
authenticator with
header
mutator for Ory Oathkeeper.
The following flow is implemented:
- Validates incoming requests at Ory Kratos using
cookie_session
authenticator - Modifies request and sends
X-User
with value returned on previous step - Sends only authenticated requests to
hello
microservice withX-User: user_id
header
For more information, please refer to the Ory Oathkeeper documentation.
Ory Oathkeeper Access Rules: access-rules.yml
Ory Oathkeeper Configuration: oathkeeper.yml
git clone [email protected]:ory/examples
cd examples/oathkeeper/03-header-mutator
docker-compose up --build
- Wait for a couple of seconds and open
http://127.0.0.1:8080/hello
. - Sign up for a new account.
- Open
http://127.0.0.1:8080/hello
again. - X-User header with your user id appears in the
hello
microservice logs.
Feel free to open a discussion to provide feedback or talk about ideas, or open an issue if you want to add your example to the repository or encounter a bug. You can contribute to Ory in many ways, see the Ory Contributing Guidelines for more information.