자체 다단계 인증(MFA) 프로세스를 구현하려면 System.UserManagement 클래스에 있는 Apex 메서드를 사용합니다. Salesforce Authenticator 및 전화(SMS) 확인 메서드에는 확인 서비스를 시작하는 메서드와 확인 서비스를 완료하는 메서드로 구성된 한 쌍의 메서드가 제공됩니다. 암호 또는 시간 기반 일회용 암호(TOTP) 확인 메서드의 경우 두 번째 메서드만 사용하여 확인 서비스를 완료할 수 있습니다. MFA에 SMS를 사용하는 것은 회사의 Experience Cloud 사이트, 직원 커뮤니티, 기타 유형의 커뮤니티 포털에 액세스하는 외부 사용자에게만 지원됩니다.
필수 Edition
지원 제품: Salesforce Classic 및 Lightning Experience 모두
지원 제품: 모든 Edition
확인 메서드에 따라 사용하는 Apex 구성이 결정됩니다.
Salesforce Authenticator 또는 SMS 확인 메서드에 대한 MFA 서비스를 구현하려면 initVerificationMethod 및 verifyVerificationMethod를 사용합니다.
암호 또는 TOTP 확인 메서드에 대한 MFA 서비스를 구현하려면 verifyVerificationMethod를 사용합니다.
예 MFA를 위한 Apex 메서드
이 예는 Salesforce Authenticator 확인 메서드로 사용하는 MFA의 Apex 코드를 보여줍니다.
public void initVerification() {
// user will receive push notification on mobile device where the app is registered for MFA
identifier = UserManagement.initVerificationMethod(Auth.VerificationMethod.SALESFORCE_AUTHENTICATOR);
}
public Auth.VerificationResult verifyVerification() {
// requiring identifier from the initVerification
// user will need to take the action on the mobile device where the app is registered for MFA
return UserManagement.verifyVerificationMethod(identifier, '' , Auth.VerificationMethod.SALESFORCE_AUTHENTICATOR);
}
다음은 SMS의 예제입니다.
public void initVerification() {
// user will receive code on their registered verified phone
identifier = UserManagement.initVerificationMethod(Auth.VerificationMethod.SMS);
}
public Auth.VerificationResult verifyVerification() {
// requiring identifier from the initVerification
// the code will need to be entered in this method
return UserManagement.verifyVerificationMethod(identifier, code , Auth.VerificationMethod.SMS);
}
다음 두 가지 예시는 암호 및 TOTP 확인을 위해 verifyVerificationMethod만 사용하는 MFA의 Apex 코드를 보여줍니다.
public Auth.VerificationResult verifyVerification() {
// user will enter their password as a param in the verifyVerificationMethod for password verification method
return UserManagement.verifyVerificationMethod('', password , Auth.VerificationMethod.PASSWORD);
}
public Auth.VerificationResult verifyVerification() {
// user will enter their registered time-based one-time password (TOTP) code (token)
return UserManagement.verifyVerificationMethod('', code , Auth.VerificationMethod.TOTP);
}
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required Cookies
Always Active
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional Cookies
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising Cookies
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.