OfficeDev / skype-web-sdk-samples

Other
116 stars 75 forks source link

SfB-Online: mePerson does not return info about logged user #1

Open ybutkevych opened 8 years ago

ybutkevych commented 8 years ago

Hi guys,

I can login into Skype for Business Online. However, I cannot retrieve any info about the logged user (email, presence, photo, etc). Do I need to add some configuration to Azure AD or this functionality is not currently supported?

Thanks

antonkh commented 8 years ago

This might be due to UCWA not returning the rel=me resource (please check the response for POST /applications - it contains that rel=me resource with name, title and other contact details) and UCWA usually does that when the access token presented in the Authorization header doesn't contain the User.ReadWrite scope, which in turn happens when the scope isn't added in the AAD config. To check if my speculation is correct, please do the following:

  1. Check if the response for POST /applications has the rel=me resource.
  2. Check if the access token has the needed scopes. To do that extract the token from the Authorization header and decode it:
t = "ey....Yz"; // this is your token
p = t.split("."); // this gives an array of 3 elements
b = atob(p[1]); // base64 decoding
d = JSON.parse(b);
d.scp; // this is the set of scopes
ybutkevych commented 8 years ago

Thanks for your response. Indeed, there is no User.ReadWrite scope added in AAD config.

sfb scopes I can only see Contacts.ReadWrite, Conversations.Initiate and Meetings.ReadWrite.

Unfortunately, there is no option to add scope User.ReadWrite for Skype for Business Online in Azure sfb scopes

Are there any ways to add this scope or it is not supportable yet?

Thanks

sivijaya commented 8 years ago

No, currently it is not possible to add this scope on the Azure portal.

sidharthv commented 8 years ago

The scope is now available on Azure (Read/Write Skype user information (preview)). With that scope selected you should get MePerson information.