Amazon Cognito
Developer Guide

Enabling User Pool Advanced Security from Your App

After you configure the advanced security features for your user pool, you need to enable them in your web or mobile app.

For more information about adding a web or mobile app to Amazon Cognito, see Adding a Web or Mobile App to Amazon Cognito User Pools.

To use advanced security with JavaScript
  1. You might need to update your Amazon Cognito SDK to the latest version. For more information about Amazon Cognito SDKs, see Install a user pool SDK.

  2. To use the Auth SDK to enable the hosted UI, see the CognitoAuth JavaScript sample app.

  3. Set AdvancedSecurityDataCollectionFlag to true. Also, set UserPoolId to your user pool ID.

  4. In your application replace <region> with your AWS region such as us-east-1, and add this source reference to your JavaScript file:

    <script src="https://amazon-cognito-assets.<region>.amazoncognito.com/amazon-cognito-advanced-security-data.min.js"></script>

    For more information, see Sample for Amazon Cognito Auth SDK for JavaScript.

To use advanced security with Android
  1. You might need to update your Amazon Cognito SDK to the latest version. For more information about Amazon Cognito SDKs, see Install a user pool SDK.

  2. To use the Auth SDK to enable the hosted UI, see the CognitoAuth Android sample app.

  3. Use { transitive = true; } while importing aws-android-sdk-cognitoauth via maven in gradle.

    Include this as a dependency in your build.gradle file:

    compile "com.amazonaws:aws-android-sdk-cognitoidentityprovider-asf:1.0.0"

    For more information, see AWS SDK for Android - Amazon Cognito Identity Provider ASF.

To use advanced security with iOS
  1. You might need to update your Amazon Cognito SDK to the latest version. For more information about Amazon Cognito SDKs, see Install a user pool SDK.

  2. To use the Auth SDK to enable the hosted UI, see the CognitoAuth iOS sample app.

  3. To configure the Auth SDK by using Info.plist, add the PoolIdForEnablingASF key to your Amazon Cognito user pool configuration, and set it to your user pool ID.

    To configure the Auth SDK using AWSCognitoAuthConfiguration, use this initializer and specify your user pool ID as userPoolIdForEnablingASF.

    For more information, see AWSCognitoIdentityProviderASF.