Auth0 Home Blog Docs

Add data into user_metadata in login script

I would like to add some information into user_metadata inside the login script. (custom: use_mfa flag)
callback(null, {
user_id: ‘manuel_test_1’,
email: ‘’,
user_metadata: {
use_mfa: true,

Is it possible or the login script can only call the callback with user_id and email?


It’s possible and the syntax you’re using is acceptable as in it would result in a property use_mfa within user_metadata. Just have in mind that if you extend this to also return app_metadata then you’ll need to return it from the custom database script within a property named metadata instead of app_metadata as mentioned at (

1 Like

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