Question

I am trying to use the new Office 365 Discovery Service API (http://msdn.microsoft.com/en-us/library/office/dn605898%28v=office.15%29.aspx) and I am having some problems with it. I try to use the FirstSignIn API by redirecting the user to a URL similar to following:

https://api.office.com/discovery/me/FirstSignIn?redirect_uri=<myredirecturi>&scope=MyFiles.Read

The Sign In -page opens as expected and email can be entered. When next-button is clicked, I see the text "We Need a Little More Help" where user has to select either a Microsoft account or an Organizational account. When the account has been selected the redirection to the given URL occurs.

The redirection made by the discovery service is supposed to include parameters: authorization_service, token_service, discovery_resource and discovery_service among others. The problem is that these parameters are all "undefined".

&authorization_service=undefined&token_service=undefined&discovery_resource=undefined&discovery_service=undefined

What am I doing wrong? Does the Discover Service require a special kind of account? I have tried this using emails of several different Office 365 accounts as well as with one Microsoft account.

NOTE: I am using Java so I cannot use any .NET libraries that might help with this.

Was it helpful?

Solution

I was able to get this working on Node.js I am unable to use the provided libraries as well. I did most of my testing in Firefox and used custom JavaScript to interact with the FirstSignIn service.

For the accounts, I tested 4 different ones. I have 2 main Office365 accounts, 1 developer account and 1 windows live. The 3 Office365 (primaries + dev) worked great. I was prompted with the "We need a little more help" only for one of my primary accounts, which happens to be federated with ADFS.

The Windows Live account did prompt with "We need a little more help", but failed after selecting Microsoft Account. The error was "We are unable to complete your request", with some more details in the URL. (Note: I am able to connect with Windows Live using the old API).

I have read elsewhere that the discovery service has been down sometime in the last few days. Based on the fact that you did get a redirect, I doubt that is the case, but maybe it was affected by that somehow.

Based on your question above, it sounds like you are in a browser. Which one are you testing with? Again, I'm on the latest version of Firefox.

I hope this helps to solve your issue. Let me know if I can clarify anything above. In general getting the Discovery Service to work without the libraries (or maybe with them too) was quite painful, but I do finally have it all working.

OTHER TIPS

Here is the code sample from the Discovery service that shows the request flow. /FisrtSignIn is an anonymous end point, you get the information from it and then contact the authorization server to send the user to login and get an access token for Discovery, with the token you call the Discovery Service on the /Services endpoint and then you get back the Use's endpoint information. Code Sample

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top