Jonas Eriksson
Jonas Eriksson

Reputation: 171

ADAL.js and Yammer authentication

I am having what looks very similar to this question where there is low activity now: Yammer REST API: 401 Unauthorized when using Azure AD token and Yammer Delegated Permissions

Using Adal.JS I have successfully retrieved tokens for multiple services, including https://graph.windows.net, https://graph.microsoft.net and more.

However, no matter how I try, no requests to my endpoint specified as:

'https://wwww.yammer.com': 'https//wwww.yammer.com'

will always result in a 401 Unauthorized. Did anyone run into a similar problem and managed to solve it? I can't disable SSO, from one of the answers in the above mentioned question.

Upvotes: 1

Views: 629

Answers (2)

mr i.o
mr i.o

Reputation: 952

A yammer network MUST be mapped to Office 365 for ADAL integration tokens to work with Yammer API endpoints. You can tell that your network's mapping is in place if users can successfully login to Yammer using their Office 365 credentials.

I doubt this is the case for you since you're still using Yammer SSO because Yammer SSO is mutually exclusive to Office 365 sign-in for Yammer.

Yammer will be deprecating SSO on 1st Dec, 2016 so it might make some sense to start planning towards switching to Office 365 identity soon.

Upvotes: 0

Jonas Eriksson
Jonas Eriksson

Reputation: 171

As mentioned in a comment, the final problem was not 401 Unauthorized but rather missing Access-Control-Allow-Origin headers, meaning the request is successful but blocked in the browser.

After contact with Microsoft it was determined that these headers are not currently added when authenticating via ADAL.js. Customers are encouraged to use the Yammer JS SDK for now.

We were also suggested trying to build a proxy request server which would forward client requests and serve the necessary headers in the response, which we are currently exploring.

Upvotes: 1

Related Questions