Yesterday i created a rule, which added user’s metadata to response. /userinfo returned user’s metadata. However, today i updated this rule, and it is not called by /userinfo anymore. What can be the reason?
It is still called by /oauth/token though.
Rule code:
function(user, context, callback) {
console.log(context);
context.idToken.user_metadata= user.user_metadata;
callback(null, user, context);
}
Okay, the problem was that i was not sending context.
Is there a way to send user_metada without context?
function(user, context, callback) {
console.log(context);
var namespace = 'https://my-domain.my-company.com/';
context.idToken[namespace + 'user_metadata']= user.user_metadata;
callback(null, user, context);
}
What i am recieving is
"https://my-domain.my-company.com/user_metadata": {
"data1": "redux",
"data2": "ab",
"data3": "ab",
"data4": "ab",
"apellido": "One"
}
Is there a way to set key “user_metadata” instead of URL ?