Enterprise mapping to deafult value

Is there a way in Auth0 to automatically consider an email verified if it’s coming through an enterprise SSO connection?

We’ve tried the following mapping but no success.

{
    "email_verified": true
}

Hi @decosta,

You could call the managment API from a rule when the user from that connection logs in and is not verified, this would then change their status to verified. Something like this:

function (user, context, callback) {
  if(!user.email_verified && context.connectionID === {CONNECTION_ID}){

    var ManagementClient = require('auth0@2.17.0').ManagementClient;
    var management = new ManagementClient({
      token: auth0.accessToken,
      domain: auth0.domain
    });

    var params = { id: {USER_ID} };
    var data = { email_verified: true};

    management.users.update(params, data, function (err, user) {
      if (err) {
        // Handle error.
      }

      // Updated user.
      console.log(user);
    });
  }
}

I think that should do it, but be sure to test and make sure it is only verifying who you want to automatically verify.

Thanks,
Dan

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

Just tried this, and I get the following:

Bad Request: Email verification is not supported for enterprise users

@decosta,

Can you take a look at this thread and see if Mark covers it? If not I can try to get some more eyes on it.

Thanks,
Dan