This example demonstrates how to protect WunderGraph operations using Role Based Access Controls (RBAC). We integrate two APIs:
- (GraphQL) https://spacex-api.fly.dev/graphql/ is serving as our protected API.
- (REST) https://api.github is needed to validate if the authenthicated user has starred our repository.
All APIs have been integrated into a unified and fully typed interface. There are no unknown dependencies in your app.
- Copy the
.env.example
file to.env
and fill in the required values. - Install the dependencies and run the complete example in one command:
npm install && npm start
After npm start
has been executed, your browser should open a new tab and navigate to http://localhost:3000/authentication
.
The next step is to login with Github and star this repository. After this click on Call Operation
.
In the console, you can see logs emitted by the mutatingPostResolve
hook.
Read the Docs.
Join us on Discord!