James Gentes
James Gentes

Reputation: 8096

POST /token 400 (Bad Request) with ember-cli and ember-simple-auth

I just setup the example from https://github.com/simplabs/ember-cli-simple-auth-example using Cloud9 and I get a 400 Bad Request error when I try to login.

I'm pretty sure this is due to fact that Cloud9 only opens port 80 (as referenced in this note from http://log.simplabs.com/post/90339547725/using-ember-simple-auth-with-ember-cli:

As the OAuth 2.0 authenticator would by default use the same domain and port to send the authentication requests to that the Ember.js is loaded from you need to configure it to use http://localhost:3000 instead.

Unfortunately I don't know how I might work around this. Any ideas?

Upvotes: 0

Views: 468

Answers (1)

Corey
Corey

Reputation: 26

Add the host to the whitelist in the config:

window.ENV['simple-auth'] = {
  crossOriginWhitelist: ['http://some.other.domain:1234']
}

More info in the Cross Origin Authorization section of the docs

Upvotes: 0

Related Questions