Skip to content
Branch: master
Find file History

The Amazon Cognito Auth Sample

This sample demonstrates Amazon Cognito Auth found in the AWS Mobile SDK for iOS. If you need to integrate with Amazon Cognito Your User Pools and don't want to implement your own UI for sign-up and sign-in, this SDK uses a hosted page to provide a UI.


  • Xcode 9.2 and later
  • iOS 9 and later

Using the Sample

  1. The AWS Mobile SDK for iOS is available through CocoaPods. If you have not installed CocoaPods, install CocoaPods:

     sudo gem install cocoapods
     pod setup
  2. To install the AWS Mobile SDK for iOS run the following command in the directory containing this sample:

     pod install
  3. Create an Amazon Cognito User Pool. Follow the 4 steps under Creating your Cognito Identity user pool in this blog post.

  4. Configure App Integration for the App Client you created above

    1. Under Enabled Identity Providers check Cognito User Pool
    2. Under Sign in and sign out URLs specify myapp:// for both the Callback URL(s) and Sign out URL(s)
    3. Under OAuth2.0 Check Authorization code grant
    4. Under Allowed OAuth Scopes check openid
    5. Click Save changes
    6. Click Choose domain
    7. Enter a domain prefix for your auth endpoint and click Create Domain
    8. Optionally continue with Customize UI to set a background image.
  5. Open CognitoAuthSample.xcworkspace.

  6. Right Click on Info.plist and Open As->Source Code

  7. Search for SETME and replace all of the values based on the setup you just did above.

  8. Build and run the sample app.

You can’t perform that action at this time.