Question

I was just experimenting with the new Office 365 Api Tools Preview and I always receive an error when the Web Authentication broker opens in the Windows 8 app. I was able to login the very first time I used the app, but from then on I receive this error before even getting a chance to sign in. See the screenshots of the errors below (they have white background):

Message on web authentication broker screen: Message on web authentication broker screen

and after I click the back-button on the broker, i receive a second error message: error alert

If I click the "Sign Out" button nothing happens. I also tried clearing all the cache, and closing all other browser sessions. Since the login worked the very first time, I know the application is configure properly. It's almost as if it has somehow gotten into a bad state, and then cached something invalid preventing it from navigating to the login page correctly.

Last note is, the only other thing that I did to this project besides create a fresh windows 8 app, and add the connected service reference with sharepoint access was to change the start page from:

 rootFrame.Navigate(typeof(GroupedItemsPage), e.Arguments);
 rootFrame.Navigate(typeof(SharePointSamplePage), e.Arguments);

Is there anything I can clear to reset the app back to original state? or does someone know a solution for this error? I have seen it before on other apps I have been developing but it was only temporary, in this case it is occurring over and over.

Update:

After some more development time has passed, I have actually seen this same problem in a different application I am working on. It's the same thing where the WebAuthenticationBroker fails regardless of building for debug, building for release, clean solution, clear cache, etc... This second unrelated project was not using the Office365 Api Tools and was NOT using the new Azure Active Directory Library with AuthorizationContext class which is used in the Office365 api tools sample code. It uses the WebAuthenticationBroker.authenticateAsync method directly. This means the issues is likely caused by something lower level and not related to the Office tools or the AAD library. Moreover, while the WebAuthenticationBroker continues to fail I can still authenticate through the same service using a browser which means it's not low enough to be problems with the actual network either. The issue seems to last for various periods of time, either for minutes or a hours and the next time I run the application it magically works as expected.

This is a major blocker to development because without being able to authenticate and retrieve an access token no requests can be made. Considering how critical the error is, and how there doesn't seem to be anyone else complaining about this problem, perhaps it is an environmental issue? Is there any settings that would intermittently cause this issue?

Was it helpful?

Solution 2

I forgot to update this post with the solution that worked for me. Apparently the 'temporary' time period in which fiddler did not work also corresponded with when I had Fiddler open. I kept disregarding Fiddler as a potential problem since other http requests from the app would work correctly. As it turns out, there is a separate hidden AppContainer in the form of Microsoft.windows.authhost.{random}, generated specifically for the WebAuthenticationBroker which was not given an exemption in Fiddler configuration.

The original source of this answer was from Eric Lawrence himself in reply to someone else who had the same issue:

https://groups.google.com/forum/?fromgroups#!topic/httpfiddler/YwpKpC2HFIQ

OTHER TIPS

The WebAuthenticationBroker does some caching which might result in the wrong token being sent over, depending on what whether you changed tenants between the original authentication and now. It appears that resetting your Windows password might be the simplest way to force a token refresh. Please share your experiences if you try this.

Additionally: if the above is in fact your problem, and you still need to be able to support multiple tenants within the same app, please see this: http://msdn.microsoft.com/en-us/library/azure/dn151789.aspx

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