Activating user pool advanced security from your app - Amazon Cognito
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

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.

  1. Add the Amazon Cognito Identity SDK for JavaScript to your app.

  2. In CognitoUserPool.js, set AdvancedSecurityDataCollectionFlag to true. Set UserPoolId to your user pool ID.

  3. Add this source reference to your app's JavaScript file. Replace <region> with an Amazon Web Services Region from the following list: us-east-1, us-east-2, us-west-2, eu-west-1, eu-west-2, or eu-central-1.

    <script src="https://amazon-cognito-assets.<region>.amazoncognito.com/amazon-cognito-advanced-security-data.min.js"></script>
  1. Create your app with Amazon Amplify for Android. For more information, see Project Setup in the Amazon Amplify Dev Center.

  2. With userContextDataProvider, include user and device information in your authentication requests.

For information about adding user context data in the legacy Android SDK, see aws-android-sdk-cognitoidentityprovider-asf.

  1. Create your app with Amazon Amplify for Swift or Flutter. For more information, see Swift Project Setup and Flutter Project Setup in the Amazon Amplify Dev Center.

  2. Include user and device information in your authentication requests. For an example to use with the InitiateAuth API operation, see userContextData in InitiateAuthInput+Amplify.swift on GitHub.

For information about adding user context data in the legacy iOS SDK, see AWSCognitoIdentityProviderASF.