# Can you set the audience parameter in a rule?

**URL:** <https://community.auth0.com/t/can-you-set-the-audience-parameter-in-a-rule/66251>\
**Category:** Get Help\
**Created:** [July 15, 2021, 6:55pm UTC](https://community.auth0.com/t/can-you-set-the-audience-parameter-in-a-rule/66251 "2021-07-15T18:55:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gratus-BenchSci](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gratus-benchsci/32/22674_2.png) [@Gratus-BenchSci](https://community.auth0.com/u/Gratus-BenchSci)\
**Post date:** [July 15, 2021, 6:55pm UTC](https://community.auth0.com/t/can-you-set-the-audience-parameter-in-a-rule/66251/1 "2021-07-15T18:55:12Z")

</div>

Is there a way to set the audience that is being returned within the context of a rule?  
Once a user is authenticated, we may be able to establish they can have access to additional aud values.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 15, 2021, 6:58pm UTC](https://community.auth0.com/t/can-you-set-the-audience-parameter-in-a-rule/66251/2 "2021-07-15T18:58:21Z")

</div>

@Gratus-BenchSci,

I moved this to a new topic for clarity.

> [@Gratus-BenchSci](#):
>
> is there a way to set the audience that is being returned within the context of a rule?

No, this isn’t possible. The audience param should reflect a default audience or a requested audience.

If you tell me more about your use case we might be able to figure out another solution. It doesn’t sound like audience would be the right claim for this type of information.

---

<div class="post-metadata">

**Author:** ![Gratus-BenchSci](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gratus-benchsci/32/22674_2.png) [@Gratus-BenchSci](https://community.auth0.com/u/Gratus-BenchSci)\
**Post date:** [July 15, 2021, 7:21pm UTC](https://community.auth0.com/t/can-you-set-the-audience-parameter-in-a-rule/66251/3 "2021-07-15T19:21:28Z")

</div>

Would we be able to control scopes? We can use the requested audience but based on user properties we want to limit the scopes they have.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 15, 2021, 7:41pm UTC](https://community.auth0.com/t/can-you-set-the-audience-parameter-in-a-rule/66251/4 "2021-07-15T19:41:47Z")

</div>

Generally, you can’t update the standard claims of the token in a rule.

In your case, you should probably add a [custom claim](https://auth0.com/docs/tokens/create-namespaced-custom-claims) to the token.

---

<div class="post-metadata">

**Author:** ![Gratus-BenchSci](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gratus-benchsci/32/22674_2.png) [@Gratus-BenchSci](https://community.auth0.com/u/Gratus-BenchSci)\
**Post date:** [July 15, 2021, 7:54pm UTC](https://community.auth0.com/t/can-you-set-the-audience-parameter-in-a-rule/66251/5 "2021-07-15T19:54:57Z")

</div>

Great thank you - and the custom claim could be added to the access token. Is the access token surfaced as part of the context object (similar to the id token)?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 15, 2021, 7:55pm UTC](https://community.auth0.com/t/can-you-set-the-audience-parameter-in-a-rule/66251/7 "2021-07-15T19:55:45Z")

</div>

@Gratus-BenchSci,

Yes, that is correct.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [July 30, 2021, 7:55pm UTC](https://community.auth0.com/t/can-you-set-the-audience-parameter-in-a-rule/66251/8 "2021-07-30T19:55:46Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
