strongloop / loopback-component-oauth2

oAuth 2.0 server for LoopBack
http://www.strongloop.com
Other
62 stars 63 forks source link

How setup crossdomain allow in exchange/clientCredentials.js #17

Closed zetflo closed 9 years ago

zetflo commented 9 years ago

Hello,

I need to activate cross domain at the token retrieval request ( /oauth/token ) . Currently the CORS is managed side loopback rest but not in the loopback file component-OAuth2/lib/exchange/clientCredentials.js .

How to configure the CORS for this query ?

raymondfeng commented 9 years ago

You can enable CORS by adding the cors middleware (https://github.com/troygoode/node-cors). Feel free to submit a PR so that we enable it by default.

zetflo commented 9 years ago

Great, it's work perfectly.

Thanks for your reply.