I am using the yammer JavaScript SDK (platform_js_sdk.js) within SharePoint Online to get a list of groups the logged in user belongs to. I have the logic working but the issue is with the authentication process. Every time a user opens their browser, they are presented with the "Login with Yammer" button which they have to click to authenticate themselves. If they close and start again, they have to go through the login again. It seems the authentication token is not persisted for some reason. We have single-sign-on enabled in our environment so navigating to Yammer directly works fine.
So, the following code:
yam.connect.loginButton('#my-login', function (resp) { ...... }
returns the following in IE 11:
XMLHttpRequest for https://www.yammer.com/platform/login_status.json?client_id=MY_CLIENT_ID&_=SOME_NUMBER required Cross Origin Resource Sharing (CORS).
and the following in Chrome:
https://www.yammer.com/platform/login_status.json?client_id=MY_CLIENT_ID&_=SOME_NUMBER 401 (Unauthorized)
Any help would be much appreciated.