0
votes

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.

2
I have the same problem. Did you find any workaround?nit

2 Answers

0
votes

Do you have your Javascript Origins filled out correctly? See this article for details on how to set them up if they aren't: https://developer.yammer.com/upgrading-to-the-new-yammer-js-sdk/

0
votes

Have you tried calling yam.getLoginStatus() beforehand? In my case, poking yam.getLoginStatus() will resume the previous session as long as your cookies are intact.