# Storing app\_metadata in a Customer Connector

**URL:** <https://community.auth0.com/t/storing-app-metadata-in-a-customer-connector/24682>\
**Category:** Get Help\
**Tags:** app\_metadata, bug, auth0\
**Created:** [May 1, 2019, 6:26am UTC](https://community.auth0.com/t/storing-app-metadata-in-a-customer-connector/24682 "2019-05-01T06:26:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NigelGodfrey](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nigelgodfrey/32/9896_2.png) [@NigelGodfrey](https://community.auth0.com/u/NigelGodfrey)\
**Post date:** [May 1, 2019, 6:26am UTC](https://community.auth0.com/t/storing-app-metadata-in-a-customer-connector/24682/1 "2019-05-01T06:26:50Z")

</div>

I am trying to store the accessToken from an IdP in app\_metadata from within an Custom Social Connection. The Profile is being created correctly.

The accessToken is available, as I can use one of the standard Profile fields to store it.

However all my built in Social connections use an app\_metadata rule for consistency.

This is my code in Fetch user Profile Script.

```
function(accessToken, ctx, cb) {
  request.get('https://api.pinterest.com/v1/me/', {
    headers: {
      'Authorization': 'Bearer ' + accessToken
    }
  }, function(e, r, b) {
    if (e) return cb(e);
    if (r.statusCode !== 200) return cb(new Error('StatusCode: ' + r.statusCode));
    var profile = JSON.parse(b);
    profile.app_metadata = profile.app_metadata || {};
    profile.app_metadata.oauthToken = accessToken;
    cb(null, {
      user_id: profile.data.id,
      family_name: profile.data.last_name,
      given_name: profile.data.first_name,
      name: profile.data.first_name + " " + profile.data.last_name
    });
  });
}

```

This part was previously suggested on the forum.

```
profile.app_metadata = profile.app_metadata || {};
profile.app_metadata.oauthToken = accessToken;

```

But nothing is stored. However…

`nickname = accessToken`

Stores the accessToken in the Profile.

The documentation, the support forum and support all seem to contradict each other. Maybe there is someone else who can help please ?

---

<div class="post-metadata">

**Author:** ![NigelGodfrey](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nigelgodfrey/32/9896_2.png) [@NigelGodfrey](https://community.auth0.com/u/NigelGodfrey)\
**Post date:** [May 5, 2019, 11:18am UTC](https://community.auth0.com/t/storing-app-metadata-in-a-customer-connector/24682/2 "2019-05-05T11:18:12Z")

</div>

I am curious as to why I don’t get even a hint of help on this ?

Does anyone know where I might either a) get or b) pay for some help ?

Despite paying auth0 their support seem utter clueless - even the “senior” engineers.

---

<div class="post-metadata">

**Author:** ![NigelGodfrey](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nigelgodfrey/32/9896_2.png) [@NigelGodfrey](https://community.auth0.com/u/NigelGodfrey)\
**Post date:** [May 13, 2019, 6:57pm UTC](https://community.auth0.com/t/storing-app-metadata-in-a-customer-connector/24682/3 "2019-05-13T18:57:53Z")

</div>

OK, so it seems like auth0 won’t support Customer Connections even when it clearly doesn’t work.

As a workaround I stored the token in another profile field and then swapped it around in a rule.

Not ideal, but it worked.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [September 3, 2019, 8:05am UTC](https://community.auth0.com/t/storing-app-metadata-in-a-customer-connector/24682/4 "2019-09-03T08:05:04Z")

</div>


