# How to send client side data via authorize

**URL:** <https://community.auth0.com/t/how-to-send-client-side-data-via-authorize/109996>\
**Category:** Get Help\
**Tags:** signup-prompt-new-experience, login-experience\
**Created:** [June 26, 2023, 8:55pm UTC](https://community.auth0.com/t/how-to-send-client-side-data-via-authorize/109996 "2023-06-26T20:55:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fnadeau](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@fnadeau](https://community.auth0.com/u/fnadeau)\
**Post date:** [June 26, 2023, 8:55pm UTC](https://community.auth0.com/t/how-to-send-client-side-data-via-authorize/109996/1 "2023-06-26T20:55:23Z")

</div>

Good day,

I am using **react-native-auth0**

I would like to pass along some extra data, to be used in a server side action on Auth0.

In my react-native code, I am doing something like this:

```auto
const {authorize, getCredentials, user, clearSession, error} = useAuth0();

...

await authorize(
    {
      scope:
        'openid profile offline_access enroll read:authenticators remove:authenticators',
      audience: `https://${config.auth0.domain}/mfa/`,
      user_metadata: {
        invitationToken: 'MY_INVITE_TOKEN',
      },
    },
    {
      ephemeralSession: true,
    },
  );

```

But for some reason, user\_metadata is not accable inside the Action, nor is it showing up in the logs.

How can I pass some client side data to the authorize flow (I need it for both Login and Signup)?

Thank you,

Franck

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [June 27, 2023, 3:17pm UTC](https://community.auth0.com/t/how-to-send-client-side-data-via-authorize/109996/3 "2023-06-27T15:17:07Z")

</div>

Hey there @fnadeau !

Happy to work on this together.

I would need a few details -

1. Can you please confirm you refer to this auth0 [SDK](https://github.com/auth0/react-native-auth0)?  
Is there a compatibility between your app’s React Native SDK version and the chosen auth0 SDK (can be checked in the [Readme](https://github.com/auth0/react-native-auth0#readme).md )

2. If I’m not mistaken the `authorize` method you shared here is to bring the user to the login page to authenticate. What Login page you use? Universal Login / New universal Login / embedded login?

3. Could share more information on the action you’re working on?

- what [flow](https://auth0.com/docs/customize/actions/flows-and-triggers) and trigger you refer to?

Thanks!

---

<div class="post-metadata">

**Author:** ![fnadeau](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@fnadeau](https://community.auth0.com/u/fnadeau)\
**Post date:** [June 27, 2023, 3:58pm UTC](https://community.auth0.com/t/how-to-send-client-side-data-via-authorize/109996/4 "2023-06-27T15:58:25Z")

</div>

1. Yes, I am using the SDK that you linked above. Here is my entry in package.json  
`"react-native-auth0": "^2.17.4"`

2. Yes, authorize shows the login page, BUT users can also sign-up form that page. We are using `New Universal login`.

3. On [Pre User Registration](https://auth0.com/docs/customize/actions/flows-and-triggers/pre-user-registration-flow) we want to validate an internal-invitation-token (token generated by our system when inviting a user to one of our tasks). We also want to verify if there is a similar token on [Login](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow).

Thank you for the help.

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [June 28, 2023, 12:01pm UTC](https://community.auth0.com/t/how-to-send-client-side-data-via-authorize/109996/6 "2023-06-28T12:01:50Z")

</div>

Hey Franck @fnadeau !  
The issue you encounter here can be reduced to IdP not supporting the custom ‘user\_metadata’ parameter in /[authorize](https://auth0.com/docs/api/authentication#database-ad-ldap-passive-) requests.

The parameter you would like to use (I assume) can be classified as “[upstream parameter](https://auth0.com/docs/authenticate/identity-providers/pass-parameters-to-idps#dynamic-parameters)” which would be sent to IdP in /authorize requests.

Upstream parameters, with some limitations, have to be first set for specific connection (like for example Username-Password-Authentication) via the Management API to make them available for /authorize requests.

It works this way:

There is a preset list of fields that you can map your custom parameter with.  
Once you choose the field, use it in your /authorize requests.

Example:  
Updating connection with an upstream parameter:

```auto
curl --request PATCH \
  --url 'https://{yourDomain}/api/v2/connections/specific_connection' \
  --header 'authorization: Bearer {yourMgmtApiAccessToken}' \
  --header 'content-type: application/json' \
  --data '{
  'options': {
    'upstream_params': {
      'screen_name': {
        'alias': 'login_hint'
      }
    }
  }
}'

```

Where: ‘login\_hint’ is a preset field, and ‘screen\_name’ is a custom parameter of your choice. Login\_hint used in /authorize parameters will be passed as ‘screen\_name’ to Auth0.

I think you could try with this approach (a [guidance](https://auth0.com/docs/authenticate/identity-providers/pass-parameters-to-idps#limitations) with the list of available fields here). Please let me know if that works for you. Thanks!

---

<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 12, 2023, 12:02pm UTC](https://community.auth0.com/t/how-to-send-client-side-data-via-authorize/109996/7 "2023-07-12T12:02:41Z")

</div>

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