/AWS1/IF_CGP=>ADMINSETUSERMFAPREFERENCE()¶
About AdminSetUserMFAPreference¶
Sets the user's multi-factor authentication (MFA) preference, including which MFA options are activated, and if any are preferred. Only one factor can be set as preferred. The preferred MFA factor will be used to authenticate a user if multiple factors are activated. If multiple options are activated and no preference is set, a challenge to choose an MFA option will be returned during sign-in.
Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.
Learn more
Method Signature¶
METHODS /AWS1/IF_CGP~ADMINSETUSERMFAPREFERENCE
IMPORTING
!IO_SMSMFASETTINGS TYPE REF TO /AWS1/CL_CGPSMSMFASETTINGSTYPE OPTIONAL
!IO_SOFTWARETOKENMFASETTINGS TYPE REF TO /AWS1/CL_CGPSOFTWARETOKMFAST00 OPTIONAL
!IO_EMAILMFASETTINGS TYPE REF TO /AWS1/CL_CGPEMAILMFASTGSTYPE OPTIONAL
!IV_USERNAME TYPE /AWS1/CGPUSERNAMETYPE OPTIONAL
!IV_USERPOOLID TYPE /AWS1/CGPUSERPOOLIDTYPE OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cgpadminsetusermfap01
RAISING
/AWS1/CX_CGPINTERNALERROREX
/AWS1/CX_CGPINVALIDPARAMETEREX
/AWS1/CX_CGPNOTAUTHORIZEDEX
/AWS1/CX_CGPPASSWORDRESETREQ00
/AWS1/CX_CGPRESOURCENOTFOUNDEX
/AWS1/CX_CGPUSERNOTCONFIRMEDEX
/AWS1/CX_CGPUSERNOTFOUNDEX
/AWS1/CX_CGPCLIENTEXC
/AWS1/CX_CGPSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_username TYPE /AWS1/CGPUSERNAMETYPE /AWS1/CGPUSERNAMETYPE¶
The name of the user that you want to query or modify. The value of this parameter is typically your user's username, but it can be any of their alias attributes. If
usernameisn't an alias attribute in your user pool, this value must be thesubof a local user or the username of a user from a third-party IdP.
iv_userpoolid TYPE /AWS1/CGPUSERPOOLIDTYPE /AWS1/CGPUSERPOOLIDTYPE¶
The ID of the user pool where you want to set a user's MFA preferences.
Optional arguments:¶
io_smsmfasettings TYPE REF TO /AWS1/CL_CGPSMSMFASETTINGSTYPE /AWS1/CL_CGPSMSMFASETTINGSTYPE¶
User preferences for SMS message MFA. Activates or deactivates SMS MFA and sets it as the preferred MFA method when multiple methods are available.
io_softwaretokenmfasettings TYPE REF TO /AWS1/CL_CGPSOFTWARETOKMFAST00 /AWS1/CL_CGPSOFTWARETOKMFAST00¶
User preferences for time-based one-time password (TOTP) MFA. Activates or deactivates TOTP MFA and sets it as the preferred MFA method when multiple methods are available. This operation can set TOTP as a user's preferred MFA method before they register a TOTP authenticator.
io_emailmfasettings TYPE REF TO /AWS1/CL_CGPEMAILMFASTGSTYPE /AWS1/CL_CGPEMAILMFASTGSTYPE¶
User preferences for email message MFA. Activates or deactivates email MFA and sets it as the preferred MFA method when multiple methods are available. To activate this setting, your user pool must be in the Essentials tier or higher.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_cgpadminsetusermfap01 /AWS1/CL_CGPADMINSETUSERMFAP01¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->adminsetusermfapreference(
io_emailmfasettings = new /aws1/cl_cgpemailmfastgstype(
iv_enabled = ABAP_TRUE
iv_preferredmfa = ABAP_TRUE
)
io_smsmfasettings = new /aws1/cl_cgpsmsmfasettingstype(
iv_enabled = ABAP_TRUE
iv_preferredmfa = ABAP_TRUE
)
io_softwaretokenmfasettings = new /aws1/cl_cgpsoftwaretokmfast00(
iv_enabled = ABAP_TRUE
iv_preferredmfa = ABAP_TRUE
)
iv_username = |string|
iv_userpoolid = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
ENDIF.