• Mahesh Raghuraman
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
I would like to verify community user using email address to confirm their identity using initRegisterVerificationMethod / verifyRegisterVerificationMethod. The below code when executed from Developer Console gives "Failed to get network info." error:

String userId = UserInfo.getUserId();
User u = [Select email, MobilePhone, Id from User Where Id=:userId];
//String mPh = getFormattedSms(u.MobilePhone); //Not sure why type cast issue (String) from the type anon is generated.
System.Debug(u.MobilePhone);
String exceptionText = System.UserManagement.initRegisterVerificationMethod(Auth.VerificationMethod.SMS);
System.Debug(exceptionText); //Same network error
exceptionText = System.UserManagement.initRegisterVerificationMethod(Auth.VerificationMethod.EMAIL);
System.Debug(exceptionText); //Same network error

Please let me know how to resolve this issue. Also how does iniRVM knows which mobile/email id to consider? Thanks, Mahesh

Reference-1: https://releasenotes.docs.salesforce.com/en-us/spring19/release-notes/rn_identity_login_custom_verify_pages.htm
Ref-2: https://developer.salesforce.com/docs/atlas.en-us.externalidentityImplGuide.meta/externalidentityImplGuide/external_identity_passwordless_custom_verification.htm