An error was encountered with the requested page AWS User Pool with Swift

Viewed 4040

I'm trying to use AWS Cognite User Pool to login with AppleId for iOS application. We couldn't use federated identity, I must use User Pool. While login User Pool, I use hosted UI in iOS application. I had set up service configuration on Aws and iOS application seen below. When I tried to login User Pool, I take a 'An error was encountered with the requested page ' error in WebView.

let hostedUIOptions = HostedUIOptions(identityProvider: "SignInWithApple")

    AWSMobileClient.default().showSignIn(navigationController: self.navigationController!, hostedUIOptions: hostedUIOptions) { (userState, error) in
        if let error = error as? AWSMobileClientError {
            print(error.localizedDescription)
        }
        if let userState = userState {
            print("Status: \(userState.rawValue)")
        }
    }

AWSConfiguration.json

{
"IdentityManager": {
    "Default": {}
},

"CognitoUserPool": {
    "Default": {
        "PoolId": "eu-west-1_rsPBto6Jx",
        "AppClientId": "6atv5t6egacicor9cioXXXXXX",
        "AppClientSecret": "171du4k8rf098lmnuvhm2h3o1umqcdfnngcj84tc304moXXXXXXXX",
        "Region": "us-east-2"
    }
},
"Auth": {
       "Default": {
           "OAuth": {
               "WebDomain": "XXXXX.auth.us-east-2.amazoncognito.com",
               "AppClientId": "6atv5t6egacicor9cioXXXXXX",
               "AppClientSecret": "171du4k8rf098lmnuvhm2h3o1umqcdfnngcj84tc304moXXXXXXXX",
               "SignInRedirectURI": "myapp://",
               "SignOutRedirectURI": "myapp://",
               "Scopes": ["openid", "email","aws.cognito.signin.user.admin","profile","phone"]
           }
       }
   }

}

How can I solve this problem?

Solution

When I add callback url in consol myapp://sigout, problem was solved.It is my mistake.

0 Answers
Related