faint-bear-71759
12/04/2024, 1:49 PMbrief-egg-61061
12/04/2024, 1:49 PMbrief-egg-61061
12/04/2024, 1:50 PMyaml mutators: id_token: enabled: true config: issuer_url: <http://127.0.0.1:4455/> jwks_url: file:///etc/config/oathkeeper/id_token.jwks.json claims: | { "session": {{ .Extra | toJson }} }
You can modify this configuration to include permission information in the claims. For step 3, you can use Keto's Check API to verify permissions for the authenticated user. The [Simple Access Check Guide](https://www.ory.sh/docs/keto/guides/simple-access-check-guide) mentions: "Once you authenticated the subject, you can perform permission checks by calling the check method of the OryPermissions client. The check method takes the subject, permission, and object as parameters and returns a boolean value indicating whether the permission is granted or not." To get a list of permissions, you could use Keto's List API as described in the [API overview](https://www.ory.sh/docs/keto/concepts/api-overview): "This API allows you to query relationships by providing a partial relationship. It can be used to: - list objects a user has access to - list users who have a specific role" You would need to implement this logic in your backend to fetch and include the relevant permissions in your responses to the frontend. Remember, the exact implementation will depend on your specific permission model and application architecture. The Ory documentation doesn't provide a direct, out-of-the-box solution for including permissions in the user session, but it offers the components and APIs necessary to build this functionality.