<@U04UQ68083H> Does token webhook support adding m...
# ory-copilot
r
@chilly-king-10285 Does token webhook support adding more values to the audience field of the ID token?
b
A message from kapa.ai
Yes, the token webhook does support adding more values to the audience (
aud
) field of the ID token. When handling the webhook in your endpoint, you can modify the claims of the issued tokens by returning a
200
HTTP status code with a JSON response body. In the response body, you can specify the
aud
field under
id_token
with the desired audience values. Here is an example of how you can structure your response:
Copy code
json {     "session": {       "id_token": {         "aud": ["audience1", "audience2", "audience3"]     }     }   }
Please note that the audience values you add should be valid and allowed by your OAuth 2.0 client. The audience values are validated against the allowed audiences defined in the OAuth 2.0 client. For more details, please refer to the [Ory documentation on responding to the webhook](https://www.ory.sh/docs/hydra/guides/claims-at-refresh#responding-to-the-webhook).
r
I just tried this. It didn't work
@chilly-king-10285 I just tried this. It didn't work
b
A message from kapa.ai
I'm sorry to hear that you're having trouble. Based on the information provided in the knowledge sources, there isn't specific guidance on adding more values to the audience field of the ID token using a token webhook. The sources do not provide information on this specific use case. For further assistance, I recommend checking the [Ory Hydra documentation](https://www.ory.sh/hydra/docs/) or reaching out to the Ory community through their [forums](https://community.ory.sh/) or [GitHub](https://github.com/ory/hydra) for more specific guidance.