Skip to content

Why am I getting [AuthUserPoolException: Auth UserPool not configured.] error when I initialize my React native app?

0

I am trying to build a React Native app which uses Amplify via the direct integration method, by which I mean it connects directly to my pre-configured user pool, which I supply using amplify_outputs.json (I do not have an Amplify Back End configured in the Console).

When I try to initialize my app, I receive the following error: [AuthUserPoolException: Auth UserPool not configured.]

Here is the content of my amplify_outputs.json: { "auth": { "aws_region": "eu-west-2", "user_pool_id": "eu-west-[user-pool-id]", "user_pool_client_id": "[user-pool-client-id]" } }

I want to use SRP auth. Here are my configure auth flows from my client: ALLOW_USER_AUTH ALLOW_USER_SRP_AUTH ALLOW_REFRESH_TOKEN_AUTH

Here is the code snippet which configures Amplify in my app - this code fires on app launch, so it happens before any authentication attempts are made: import { Amplify } from "@aws-amplify/core"; import amplifyconfig from "../amplify_outputs.json";

export function configureAmplify() { console.log("Configuring Amplify with:", amplifyconfig); Amplify.configure(amplifyconfig); }

I have confirmed that the amplify_outputs.json file is correctly read into the code file, so the values are definitely reaching the configure function and are available at runtime on the device.

I've also confirmed that yes, my user pool is in eu-west-2 (London)

I'm out of ideas at this point. Can anyone tell me what I'm missing? Let me know if I need to provide more information.

1 Answer
0

Should like this I believe

{
  "Auth": {
    "region": "eu-west-2",
    "userPoolId": "eu-west-[user-pool-id]",
    "userPoolWebClientId": "[user-pool-client-id]"
  }
}

EXPERT
answered a month ago
  • Hi Kidd Ip,

    Unfortunately this is not the correct answer. This doesn't confirm to the type information provided with Amplify, so I had to cast to any to allow it. Doesn't work, gives me a different error.

    The values I provided in my question do conform to the type information and they also conform to the JSON schema provided here: https://docs.amplify.aws/react-native/reference/amplify_outputs/

    I have also tried supplying the values as such - { Auth: { Cognito: { userPoolId: "eu-west-[user-pool-id]", userPoolClientId: "[user-pool-client-id]", }, }, }

    This gives me a different error - [ResourceNotFoundException: User pool client [user-pool-client-id] does not exist.]

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.