If it helps, here is the rule code below:
function addMyBackendAppIdToAccessToken(user, context, callback) {
var namespace = 'https://myapp.com/';
context.accessToken[namespace + 'myBackendAppId'] = user.app_metadata.myBackendAppId;
callback(null, user, context);
}
Also, I installed the Real-time Webtask Logs so I could watch what was happening in real time. The ID is definitely coming back from my backend and the rule is running after the new user signs up with Google. The token that the user receives does not have the myBackendAppId
claim though (the first time they log in/are redirected back to my site after sign up).
If they log out and then log back in, the new token DOES have the myBackendAppId
claim. But I need it to be there when they first sign up (for obvious reasons).
Any help would be appreciated.
Thanks again!