title: AWS Cognito error: Authentication delegate not set
body: <p>I am developing an iOS app in Swift using XCode 7.3. The app communicates with a DynamoDB database, allowing the user to read and write data. Recently, I updated my pods, which include <code>AWSDynamoDB</code>, <code>AWSCognito</code>, <code>AWSCognitoIdentityProvider</code>, and other AWS pods. I also set up a new user pool according to the instructions on this page:</p>
  
  <p><a href="http://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-integrating-user-pools-with-identity-pools.html" rel="noreferrer">http://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-integrating-user-pools-with-identity-pools.html</a></p>
  
  <p>As part of following these instructions, I put the following code in the AppDelegate class's didFinishLaunchingWithOptions method:</p>
  
  <pre><code>let serviceConfiguration = AWSServiceConfiguration(region: .USEast1, credentialsProvider: nil)
      let userPoolConfiguration = AWSCognitoIdentityUserPoolConfiguration(clientId:APP_CLIENT_ID, clientSecret: appSecret, poolId: USER_POOL_ID)
      AWSCognitoIdentityUserPool.registerCognitoIdentityUserPoolWithConfiguration(serviceConfiguration, userPoolConfiguration: userPoolConfiguration, forKey: USER_POOL_NAME)
      let pool = AWSCognitoIdentityUserPool(forKey:USER_POOL_NAME)
      let credentialsProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: IDENTITY_POOL_ID, identityProviderManager:pool)
      let configuration = AWSServiceConfiguration(region:.USEast1, credentialsProvider:credentialsProvider)
      AWSServiceManager.defaultServiceManager().defaultServiceConfiguration = configuration
  </code></pre>
  
  <p>I got the value for <code>IDENTITY_POOL_ID</code> by navigating starting from the AWS console to Cognito, Federated Identities, the identity pool I created while following the instructions, "Edit Identity Pool", and then copying the string shown next to "identity pool ID". I obtained the value for <code>APP_CLIENT_ID</code> by expanding "Authentication Providers" on the same page and selecting the "Cognito" tab. For <code>USER_POOL_NAME</code>, I used the "identity pool name" on this page, and for <code>USER_POOL_ID</code> I used the "user pool ID" value listed under "Authentication Providers". I am unclear as to whether I set these values correctly, since I wasn't entirely sure which values the developer guide was saying I should use.</p>
  
  <p>After updating the pods and making these changes, when I run the app, I see the error:</p>
  
  <p><code>[Error] AWSCredentialsProvider.m line:569 | __44-[AWSCognitoCredentialsProvider credentials]_block_invoke.345 | Unable to refresh. Error is [Error Domain=com.amazonaws.AWSCognitoIdentityProviderErrorDomain Code=-1000 "Authentication delegate not set" UserInfo={NSLocalizedDescription=Authentication delegate not set}]</code> </p>
  
  <p>It is also now impossible to access the DynamoDB data, though the app does still launch. I suspect part of the problem is that my DynamoDB database is not in USEast, but I'm unsure whether this would actually result in this error. I have tried to look up possible causes for this error in addition to changing the code in AppDelegate, but the error remains the same. What are some likely causes I can investigate? If it makes a difference, I am trying to allow the app to authorize the user in addition to restoring the DynamoDB functionality, and I would like to accomplish both in the process of fixing this issue.</p>