cold-scientist-93808
01/10/2025, 11:32 AMbrief-egg-61061
01/10/2025, 11:33 AMbrief-egg-61061
01/10/2025, 11:33 AMory patch oauth2-config --project <project-id> --workspace <workspace-id> \ --add '/oauth2/token_hook/url="<https://my-example.app/token-hook>"' \ --add '/oauth2/token_hook/auth/type="api_key"' \ --add '/oauth2/token_hook/auth/config/in="header"' \ --add '/oauth2/token_hook/auth/config/name="X-API-Key"' \ --add '/oauth2/token_hook/auth/config/value="MY API KEY"' \ --format yaml
2. Implement your webhook endpoint to modify the email scope value. Your endpoint will receive a POST request with a JSON payload containing the session and request information. 3. In your webhook response, you can modify the claims, including the email scope value, by returning a JSON object with the desired changes. Remember that the specific implementation details of modifying the email scope value will depend on your use case and how you want to handle the email information in your application. [Customizing claims with OAuth2 webhooks](https://www.ory.sh/docs/hydra/guides/claims-at-refresh) provides more detailed information on how to implement and use the token hook in Ory Hydra.