I've setup an app in Yammer and added Javascript origins but still can't make xhr request
XMLHttpRequest cannot load https://www.yammer.com/platform/login_status.json?client_id=123456789&_=123456789. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://example.com.dev:9000' is therefore not allowed access.
Any suggestion?
I'm working from a local machine and having example.com.dev to resolve as localhost.
I think the answer is in the domain name.
Use api.yammer.com instead of www.yammer.com
See for similar problem also the answer from Marco here
No 'Access-Control-Allow-Origin' header is present on the requested
resource.
You can do 2 things:
- Ask yammer.com to allow your origin, or use a non browser HTTP request, for example with cURL.
- If you develop an origin which is already allowed, then you should rewrite the hosts file and the webserver configuration on your dev machine, to bind the allowed origin to your dev site. Currently this is not an option, because there isn't any allow origin header sent according to the error message.
That's all you can do.
In addition to changing the URL to be api.yammer.com be sure that you're not including any extra headers.
For example, I was accidentally including an extra header 'X-Foo-Id' and that was tripping up Yammer.