AWS Cognito Identity Pool SignIn and SignOut in iOS

559 Views Asked by At

I'm trying to implement Cognito Identity Pools in iOS. Following link

I'm able to see Google and Facebook login. Only I'm using awsconfiguration.json. In AppDelegate.swift code is

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    AWSDDLog.add(AWSDDTTYLogger.sharedInstance)
    AWSDDLog.sharedInstance.logLevel = .info
    return AWSMobileClient.sharedInstance().interceptApplication(
        application,
        didFinishLaunchingWithOptions: launchOptions)
  1. But in console getting error

    error = Error Domain=com.amazonaws.AWS Cognito Identity ErrorDomain Code=8 "(null)" UserInfo={__type=NotAuthorizedException, message=Unauthenticated access is not supported for this identity pool.}

  2. Click on Google button, it's not at all showing anything.

  3. Click on Facebook button going to Facebook page. In console I'm able to see AccessKey, SecretKey and SessionKey. But I don't know how to SignOut.

  4. I'm doing correct or not also not sure. Please help me, wasted 4 days working on this. Please provide me proper documentation or link.

Thanks in advance.

1

There are 1 best solutions below

0
Rohan Dubal On

This is due to you not allowing un-authenticated access in your application. You can configure this in Mobile Hub by selecting allow unauthenticated users in my app while configuring user sign in.

Thanks, Rohan