1

We are using scratch orgs for automated testing. The challenge here is with every newly created scratch org, on first login you are presented with the "Register Your Mobile Phone" modal, that you need to click 'I dont want to register my mobile phone'

I am trying to find a way to disable this from appearing at all but it seems all new scratch orgs have "Enable the SMS method of identity verification" (under Security > Session Settings) enabled by default.

In the Scratch Org definition file I have tried including the following setting and it did not disbale the "Enable SMS" setting.

"securitySettings": {
"sessionSettings": {
    "enableSMSIdentity": false
}

Is there another setting that should be set?

  • We did that in production by calling salesforce so it wont come for our orgs.You can try adding ip ranges 0.0.0.0 to 255.255.255.255 sysadmin profile. If that did not work call support – Avijit Chakraborty Nov 14 '19 at 2:08
0

I don't know a way to do that, but here is what could be a workaround (not tested, please tell me if it works !)

Create a file named setUsersMobile.apex

String phoneNumber = '+33 6123456785'; // Set your real number here maybe
List<User> userList = [SELECT Id, Name,MobilePhone FROM User WHERE MobilePhone = null LIMIT 1000];
for(integer i=0; i<userList.size(); i++) {
    userList[i].MobilePhone = phoneNumber;
}
System.debug('Updating '+userList.size()+' users:'+userList);
update(userList);

Then with SalesforceDX, call

sfdx force:apex:execute -f setUsersMobile.apex

That way, the mobile phone of your scratch org users will be set, so they should not be asked to the user at the first connexion

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.