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
The AWS Mobile SDK for iOS is available through CocoaPods. If you have not installed CocoaPods, install CocoaPods:
sudo gem install cocoapods pod setup
To install the AWS Mobile SDK for iOS run the following command in the directory containing this sample:
Create an Amazon Cognito User Pool. Follow the 4 steps under Creating your Cognito Identity user pool in this blog post.
Configure App Integration for the App Client you created above
- Under Enabled Identity Providers check Cognito User Pool
- Under Sign in and sign out URLs specify
myapp://for both the Callback URL(s) and Sign out URL(s)
- Under OAuth2.0 Check Authorization code grant
- Under Allowed OAuth Scopes check openid
- Click Save changes
- Click Choose domain
- Enter a domain prefix for your auth endpoint and click Create Domain
- Optionally continue with Customize UI to set a background image.
Right Click on
Open As->Source Code
Search for SETME and replace all of the values based on the setup you just did above.
Build and run the sample app.