# Auth0 Flutter user\_metadata not returned

**URL:** <https://community.auth0.com/t/auth0-flutter-user-metadata-not-returned/116883>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [September 21, 2023, 9:22pm UTC](https://community.auth0.com/t/auth0-flutter-user-metadata-not-returned/116883 "2023-09-21T21:22:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CityHernandez](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/cityhernandez/32/71185_2.png) [@CityHernandez](https://community.auth0.com/u/CityHernandez)\
**Post date:** [September 21, 2023, 9:22pm UTC](https://community.auth0.com/t/auth0-flutter-user-metadata-not-returned/116883/1 "2023-09-21T21:22:32Z")

</div>

Hello!

I’m trying to use the auth0\_flutter pub package for my Flutter project. The [UserProfile class](https://github.com/auth0/auth0-flutter/blob/main/auth0_flutter_platform_interface/lib/src/user_profile.dart#L3) that’s used with authentication does not have `user_metadata` - is there a way to include that? The same class has an [`address`](https://github.com/auth0/auth0-flutter/blob/main/auth0_flutter_platform_interface/lib/src/user_profile.dart#L100), but what would that reflect when there’s no specified field for a user’s address in the Auth0 User management console.

Is the solution to hit the API directly without the package? Or is it necessary to set up an Action to get the information?

Please let me know if more information is needed.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [September 21, 2023, 10:00pm UTC](https://community.auth0.com/t/auth0-flutter-user-metadata-not-returned/116883/3 "2023-09-21T22:00:59Z")

</div>

Hey @CityHernandez welcome to the community!

> [@CityHernandez](#):
>
> Is the solution to hit the API directly without the package? Or is it necessary to set up an Action to get the information?

You’ll need to add a [Post-Login Action](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow) to add `metadata` to the user’s ID token - This should work:

```auto
exports.onExecutePostLogin = async (event, api) => {
  const namespace = 'https://my-app.example.com';
  if (event.authorization) {
    api.idToken.setCustomClaim(`${namespace}/user_metadata`, event.user.user_metadata);
  }
};

```

---

<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:** [October 5, 2023, 10:01pm UTC](https://community.auth0.com/t/auth0-flutter-user-metadata-not-returned/116883/4 "2023-10-05T22:01:33Z")

</div>

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