<@U04UQ68083H> is it possible to configure multipl...
# ory-copilot
b
@chilly-king-10285 is it possible to configure multiple oauth2 token hooks? or is it possible to include the client_id as header in the token_hook request
b
A message from kapa.ai
Based on the available knowledge sources: 1. Multiple OAuth2 token hooks: The documentation and issues do not mention support for configuring multiple OAuth2 token hooks simultaneously. The configuration examples and CLI commands only show a single
token_hook
being set per project or configuration. There is no evidence in the provided sources that multiple hooks can be registered or executed in sequence for the OAuth2 token endpoint. If you need to perform multiple actions, you would need to handle that logic within your single webhook endpoint. 2. Including the client_id as a header in the token_hook request: The documentation shows that you can configure authentication for the token hook using headers (e.g., API key in a custom header), but it does not mention the ability to automatically include the OAuth2
client_id
as a header in the request to the webhook. The payload sent to the webhook does include the
client_id
in the JSON body under the
session
and
request
objects, but not as an HTTP header. If you require the
client_id
as a header, you would need to extract it from the request body in your webhook handler, as there is no documented way to instruct Ory to add it as a header automatically [Customizing claims with OAuth2 webhooks](https://www.ory.sh/docs/hydra/guides/claims-at-refresh). Summary: - You cannot configure multiple OAuth2 token hooks; only one is supported. - The
client_id
is included in the webhook payload body, not as a header, and there is no documented way to add it as a header automatically. If you need more advanced routing or header customization, you would need to implement that logic in your webhook endpoint itself.