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
424 stars 232 forks source link

Trying to get Session from a local file:// returns CORS error #113

Closed raf202 closed 6 years ago

raf202 commented 6 years ago

I'm using cognito on my hybrid mobile app with Cordova, which relies on the file system, not a web server, running a web page. Whenever I make the get Session calls to .auth.us-east-1.amazoncognito.com/oauth2/token it returns the following error:

The 'Access-Control-Allow-Origin' header has a value 'null' that is not equal to the supplied origin. Origin 'null' is therefore not allowed access.

How can I get the session for hybrid javascript mobile apps if this endpoint won't allow access? Is there a different endpoint where native mobile app libraries call for this request?