confirm_device
async
¶
confirm_device(
access_token: TokenModelType,
device_key: DeviceKeyType,
*,
config_overrides: Optional[AsyncCognitoIdentityProviderClientConfig] = None,
device_secret_verifier_config: Optional[DeviceSecretVerifierConfigType] = None,
device_name: Optional[DeviceNameType] = None,
) -> ConfirmDeviceResponse
Confirms a device that a user wants to remember. A remembered device is a "Remember me on this device" option for user pools that perform authentication with the device key of a trusted device in the back end, instead of a user-provided MFA code. For more information about device authentication, see Working with user devices in your user pool.
Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.
Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.
Parameters:
-
access_token(TokenModelType) –A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for
aws.cognito.signin.user.admin. -
device_key(DeviceKeyType) –The unique identifier, or device key, of the device that you want to update the status for.
-
device_secret_verifier_config(Optional[DeviceSecretVerifierConfigType], default:None) –The configuration of the device secret verifier.
-
device_name(Optional[DeviceNameType], default:None) –A friendly name for the device, for example
MyMobilePhone.
Raises:
-
DeviceKeyExistsException–This exception is thrown when a user attempts to confirm a device with a device key that already exists.
-
ForbiddenException–This exception is thrown when WAF doesn't allow your request based on a web ACL that's associated with your user pool.
-
InternalErrorException–This exception is thrown when Amazon Cognito encounters an internal error.
-
InvalidLambdaResponseException–This exception is thrown when Amazon Cognito encounters an invalid Lambda response.
-
InvalidParameterException–This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
-
InvalidPasswordException–This exception is thrown when Amazon Cognito encounters an invalid password.
-
InvalidUserPoolConfigurationException–This exception is thrown when the user pool configuration is not valid.
-
NotAuthorizedException–This exception is thrown when a user isn't authorized.
-
OperationNotEnabledException–This exception is thrown when an operation is not available in the current region or for the current user pool configuration. This can occur when attempting to perform operations that are not supported in secondary replica regions.
-
PasswordResetRequiredException–This exception is thrown when a password reset is required.
-
ResourceNotFoundException–This exception is thrown when the Amazon Cognito service can't find the requested resource.
-
TooManyRequestsException–This exception is thrown when the user has made too many requests for a given operation.
-
UsernameExistsException–This exception is thrown when Amazon Cognito encounters a user name that already exists in the user pool.
-
UserNotConfirmedException–This exception is thrown when a user isn't confirmed successfully.
-
UserNotFoundException–This exception is thrown when a user isn't found.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cognito_identity_provider/_services/async_cognito_identity_provider.py
3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 | |