title: Can I login with user pool and cognito identity without setting authentication delegate?
body: <p>I want to offer login with federated identity, using facebook, google, and user pool (email). I have a problem getting identityId after cognito user pool sign up succeeds. The error is "Authentication delegate not set".
  I don't want to set the delegate to user pool. I managed to signup without needing it, and I just want to get the identityId.</p>
  
  <p>Can this be done with setting the delegate? Am I doing something wrong?</p>
  
  <pre><code>func setupAWS(){
      loginProvider = LoginProvider()
      userPoolConfig()
      credentialsProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "identityPoolId", identityProviderManager: userPool)
      let configuration = AWSServiceConfiguration(region: .USEast1, credentialsProvider: credentialsProvider)
      AWSServiceManager.default().defaultServiceConfiguration = configuration
  
  }
  
  func userPoolConfig(){
      let configuration = AWSServiceConfiguration(region: .USEast1, credentialsProvider: credentialsProvider)
      let userPoolConfiguration = AWSCognitoIdentityUserPoolConfiguration(clientId: "clientid", clientSecret: "clientsecret", poolId: "poolid")
      AWSCognitoIdentityUserPool.register(with: configuration, userPoolConfiguration: userPoolConfiguration, forKey: "UserPool")
      userPool = AWSCognitoIdentityUserPool(forKey: "UserPool")
  }
  
  //logins from LoginProvider
  func logins() -&gt; AWSTask&lt;NSDictionary&gt; {
      switch type {
      case .facebook:
          if let token = AccessToken.current?.authenticationToken {
              return AWSTask(result: [AWSIdentityProviderFacebook:token])
          }
          return AWSTask(error:NSError(domain: "Facebook Login", code: -1 , userInfo: ["Facebook" : "No current Facebook access token"]))
      default:
          return userService.userPool!.logins()
      }
  }
  
  //After signup
  func verificationCodeProvided(code: String){
      presenter!.user!.confirmSignUp(code).continueWith(block: { (response) -&gt; Any? in
          if response.error != nil {
              //fail
          } else {
              print("Signup succeeded")
              print("Id: \(self.presenter?.userService.credentialsProvider?.identityId)") //returns nil
  
              self.presenter!.setUser()
          }
          return nil
      })
  }
  
  //trying to get identity id
  func setUser(){        
      self.userService.credentialsProvider!.getIdentityId().continueWith(block: { (task) -&gt; Any? in
          if (task.error != nil) {
              print("Error: " + task.error!.localizedDescription) // prints "Authentication delegate not set" for user pool login
          }
          else {
              let cognitoId = task.result!
              print("Cognito id: \(cognitoId)") //Works for Facebook
          }
          return nil
      })
  }
  </code></pre>