Activating user pool advanced security from your app
After you configure the advanced security features for your user pool, you must activate them in your web or mobile app.
-
Add the Amazon Cognito Identity SDK for JavaScript
to your app. -
In CognitoUserPool.js
, set AdvancedSecurityDataCollectionFlag
totrue
. SetUserPoolId
to your user pool ID. -
Add this source reference to your app's JavaScript file. Replace
<region>
with an AWS Region from the following list:us-east-1
,us-east-2
,us-west-2
,eu-west-1
,eu-west-2
, oreu-central-1
.<script src="https://amazon-cognito-assets.
<region>
.amazoncognito.com/amazon-cognito-advanced-security-data.min.js"></script>
-
Create your app with AWS Amplify for Android. For more information, see Project Setup
in the AWS Amplify Dev Center. -
With
userContextDataProvider
, include user and device information in your authentication requests.
For information about adding user context data in the legacy Android SDK
-
Create your app with AWS Amplify for Swift or Flutter. For more information, see Swift Project Setup
and Flutter Project Setup in the AWS Amplify Dev Center. -
Include user and device information in your authentication requests. For an example to use with the InitiateAuth API operation, see
userContextData
in InitiateAuthInput+Amplify.swifton GitHub.
For information about adding user context data in the legacy iOS SDK