Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS User Pool Setup (Swift)

I am trying to use AWS Cognito User Pools to add login/signup functionality for my swift iOS app. I have set up my xcworkspace with Cocoapods. In my App Delegate I have set up my Credentials Provider and Service Configuration seen below.

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // Override point for customization after application launch.

    let credentialsProvider = AWSCognitoCredentialsProvider(regionType: AWSRegionType.USEast1, identityPoolId: cognitoIdentityPoolId)

    let defaultServiceConfiguration = AWSServiceConfiguration(region: AWSRegionType.USEast1, credentialsProvider: credentialsProvider)

    AWSServiceManager.defaultServiceManager().defaultServiceConfiguration = defaultServiceConfiguration

    return true
}

but when i try to set up the user pool configuration with:

let configurationUserPool = AWSCognitoIdentityUserPoolConfiguration(clientId: "###", clientSecret: "#########", poolId: "###")

i get a compilation error of "use of unresolved identifier AWSCognitoIdentityUserPoolConfiguration", which i dont understand because i have imported AWSCore and AWSCognito

any help or insight would be much appreciated thanks

like image 694
jackets14 Avatar asked Jun 15 '16 15:06

jackets14


People also ask

What is an AWS user pool?

A user pool is a user directory in Amazon Cognito. With a user pool, your users can sign in to your web or mobile app through Amazon Cognito. Your users can also sign in through social identity providers like Google, Facebook, Amazon, or Apple, and through SAML identity providers.

How do I connect identity pool to user pool?

Enter the User Pool ID. Enter the App Client ID. This must be the same client app ID that you received when you created the app in the User pools section of the console. If you have additional apps or user pools, choose Add Another Provider and enter the User Pool ID and App Client ID for each app in each user pool.

What is Admin_no_srp_auth?

ADMIN_NO_SRP_AUTH : Non-SRP authentication flow; you can pass in the USERNAME and PASSWORD directly if the flow is enabled for calling the app client. ADMIN_USER_PASSWORD_AUTH : Admin-based user password authentication. This replaces the ADMIN_NO_SRP_AUTH authentication flow.


1 Answers

import AWSCognitoIdentityProvider

Must also be added to the project and imported in your AppDelegate class in order for that method to be accessible.

like image 158
Garrett Cox Avatar answered Sep 26 '22 02:09

Garrett Cox