title: Integrate Facebook login with AWS Cognito User Pool
body: <p>I'm trying to integrate aws user pool in my project. I manage to do a normal login with email and password, but I need to add login in with Facebook.</p>
  
  <p>From what I read in documentation, for this I need to create an Indentity pool in Federated identities. I create one and I add the follow configurations for Authentication providers:
  - in Facebook tab to add my Facebook App ID, 
  - and in Cognito tab to add my user pool id and app client id for my user pool. </p>
  
  <p>And inside of my user pool, In Identity providers from federation, I select Facebook and for this I add my Facebook app ID and App secret.</p>
  
  <p>In my app I implement a AWSIdentityProviderManager that contain: </p>
  
  <pre><code>class CognitoSocialProvider: AWSIdentityProviderManager {
  
     func logins() -&gt; AWSTask&lt;NSDictionary&gt; {
        if let token = FBSDKAccessToken.current() {
          return AWSTask(result: [AWSIdentityProviderFacebook:token.tokenString])
        }
        return AWSTask(error:NSError(domain: kCognitoFacebookDomainError, code: -1 , userInfo: [kCognitoFaceook : kCognitoFacebookInvalidAccessToken]))
     }
  }
  </code></pre>
  
  <p>And here is my code for Facebook login:</p>
  
  <pre><code>    let loginManager = FBSDKLoginManager()
      let permisions = [kCognitoFacebookPublicProfil, kCognitoFacebookEmail]
      loginManager.logIn(withReadPermissions: permisions,
                         from: parentVC) { (result, error) in
                          if (error != nil) {
                              failure(error! as NSError)
                          } else if (result?.isCancelled == true){
                              failure(NSError())
                          } else {
                              let socialProvider = CognitoSocialProvider()
                  provider = AWSCognitoCredentialsProvider(regionType: REGION,
                                               identityPoolId: IDENTITY_POOL,
                              identityProviderManager: socialProvider)
                  let serviceConfiguration = AWSServiceConfiguration(region: REGION, credentialsProvider: provider)
                  AWSServiceManager.default().defaultServiceConfiguration = serviceConfiguration
                  provider.clearKeychain()
                  provider.clearCredentials()
                  provider.credentials().continueWith { (task) -&gt; Any? in
                  DispatchQueue.main.async(execute: {
                          if let error = task.error as NSError? {
                                  failure(error)
                          } else {
                                  let response = task.result! as AWSCredentials
                                  success(CognitoFacebookSession(credentials: response))
  
                          }
                  })
                  return nil
                }
          }
  </code></pre>
  
  <p>The login work, but when I look in my user pool in user an groups section, I can't see my user over there.</p>
  
  <p>There is any other solution to integrate Facebook login, using only user pool without using Identity pool?</p>