amazon-archives / amazon-cognito-auth-js

The Amazon Cognito Auth SDK for JavaScript simplifies adding sign-up, sign-in with user profile functionality to web apps.
Apache License 2.0
423 stars 232 forks source link

404 error on callback URL #130

Open FabioDominio opened 6 years ago

FabioDominio commented 6 years ago

Good evening,

as reported in the issue title, I am experiencing a strange situation after a successful authentication.

Namely, after authenticating by the Cognito hosted web page (as it seems it's the only option with this library), although the authenticator correctly redirects to the provided callback URL the browser stops with error 404 complaining it is not able to retrieve the requested resource.

The strange thing is that if I simply refresh the page or click return on the address bar, the landing page is correctly retrieved with valid tokens and no error.

As additional information, note how I am using the library in the client side as the app in my case is the frontend website calling APIs from a RESTful server acting as a resource server using the access tokens to limit the API access to authenticated users. Note also how that for development purposes both the web app and the REST server are hosted locally, so the redirect uri is https://localhost...

Thanks.