Auth0: passing custom fields in getAccessTokenSilently in order to be used in rules

We are using Auth0 SDK and trying to include a custom option to rule/access-token after login. The purpose is to be able to inject dynamic params into payload from rules. Client is a react.js app and we use @auth0/auth0-react library. Noticed that getAccessTokenSilently is extensible to include custom params:

const { getAccessTokenSilently } = useAuth0();
const accessToken = await getAccessTokenSilently({
        audience: 'myaudience',
        scope: 'read:read_users',
        'foo': 'bar'

The question is, how do we get access to foo=bar from inside the rules? Thanks

P.S: solution this could not help solve our problem.

Hi @sharbel.shuker,

Welcome to the Auth0 Community!

You should be able to see the request params in the context.request.query object.

Are you not seeing them in your rule?

Hi @dan.woda
no, unfortunately, I can not see these variables in the rules.
only if this variable is specified within the Auth0Provider.
is it possible to pass it while requesting a token?

Hi @sharbel.shuker,

After some testing, I can’t seem to get them to show up either. Let me reach out to our team and see if I can get to the bottom of it. I’ll report back when I have an answer.

Hi @dan.woda ,

That would be great, many thanks in advance :slight_smile: