"Network Failure" when using "Login with User Pools"

0

Yesterday I changed my AppSync API to Auth Mode AMAZON COGNITO_USER_POOLS. I created a Cognito user pool and was able to use the "Login with User Pools" button on the "Queries" section to authenticate via group-membership (@aws_auth(cognito_groups: ["groupname"]))
Today I'm getting a "Network Failure" message when trying to authenticate with my User Pool login.
All services are running in us-east-1.
Any idea why this is happening?

Edited by: vossberg on Dec 27, 2017 1:11 PM

asked 6 years ago1731 views
6 Answers
0

Hi Jeff
thank you very much for your reply.

It is showing the same error also with a fresh setup:

Region: us-east-1 (same happens with us-east-2)

  1. Create a User Pool with Default settings
  2. Create a new AppSync API ("Custom schema")
  3. Change Authorization type to "Cognito User Pool" and configure the new pool from above
  4. Open "Queries" page
    The "result" window on the right now shows this message in red:

e.exports@https://d1owibxkfb9jfd.cloudfront.net/c170c3d5cba9771150547efa6d42c0cab5dcf71c/main.js:131:61094
e.exports@https://d1owibxkfb9jfd.cloudfront.net/c170c3d5cba9771150547efa6d42c0cab5dcf71c/main.js:147:217017
e.exports/</d[h]@https://d1owibxkfb9jfd.cloudfront.net/c170c3d5cba9771150547efa6d42c0cab5dcf71c/main.js:131:59856

This is same message I'm getting when I open the Queries page with my API that had already worked. Is this expected bevavior or an indication for case 1 from your email?

My ReactJS app is able to authenticate a user from a Cognito user pool with aws-amplify, when trying to use the received Jwt Token to access the AppSync API I'm also getting the mentioned "Network Failure". I'm using aws-appsync to access the API.

Thanks again for looking into this,
Lucas

answered 6 years ago
profile picture
EXPERT
reviewed 15 days ago
0

Hi,

Sorry for the issues. It could be one of two things, I believe.

  1. As the error message implies, a temporary networking issue on our end. Are you still seeing the issue? If not, it was probably this.

  2. If you have seen issues consistently, then it's probably related to your configuration. Double check that the Cognito configuration (user pool id...etc.) is valid and the same as the one you're using on your client. We'll work on cleaning up the error message, as this is admittedly counter intuitive given the error message you received.

Thanks,
Jeff

answered 6 years ago
0

Hi,

Sorry, I had a typo above (fixed it). It should have said it was the networking issue if you weren't still seeing it, so the fact that you were probably means it was option 2.

Are you 100% sure your client side Cognito stuff is exactly what you provided your api when creating it? If so, can you DM me what those were?

answered 6 years ago
0

Hi,
I found the reason for the error: The "Queries" page uses changing Cloudfront hostnames and I missed the fact, that my NoScript extension from Firefox had not been authorized for the changed hostname. Parts of the JS were not executed.
Very obvious ones I realized my mistake. Sorry for the trouble. I appreciate your efforts to help!
Best regards and a great start for 2018 to everyone!
Lucas

answered 6 years ago
0

Happy to hear that's up and running, but did it also resolve you seeing that issue from the react/amplify app?

answered 6 years ago
0

Hi,
yes, sorry for the partial update. The "Error: Network error: Network request failed with status 500" in my React/Amplify web app indeed was caused by using a different User Pool than I had configured in AppSync. Now the app is authenticating fine and the access rules configured with "@aws_auth(cognito_groups: ..." are working.

I'm still getting this error
"https://cognito-identity.us-east-1.amazonaws.com/ 400 (Bad Request)"
when running

Amplify.configure({
    Auth: {
        identityPoolId: 'us-east-1:xyz', 
        region: 'us-east-1', 
        userPoolId: 'us-east-1_xyz', 
        userPoolWebClientId: 'xyz', 
    }
});

If I leave out the "identityPoolId" line, the error doesn't show up and the app still works.
On the pool dashboard I can see several anonymous identities handed-out from the Pool, so the pool itself is working. Though here is says the line is required:
https://github.com/aws/aws-amplify/blob/master/docs/media/quick_start.md#configuration

I've yet to understand the reason it is necessary to configure it. I'll do some more reading and open a new thread when I've more questions about the identityPoolId.

Lucas

answered 6 years ago

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.

Guidelines for Answering Questions