Storing app_metadata in a Customer Connector

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 ?

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.

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.