What Are the Likely Causes of a Xamarin Android App Failing to Properly Authenticate with Office365?

Basically, I'm trying to run a Xamarin app created by Mayur Tendulkar:


In my case, I'm trying to execute and deploy the Android mobile app (using Visual Studio 2015 and the Xamarin plugin) that connects to an instance of Office 365. After doing the initial prep work by configuring Azure Active Directory and my instance of Office 365, I've run the app within the emulator and on my Samsung phone. In both cases, the following seems to occur:

Screen #1: I hit the Login button, which then requests for my credentials.

Screen #2: I specify the name and password for my Office365 account.

Screen #3: It then takes me to a screen that tells me about the mobile app's intentions (look at your calendar, look at your email, etc.) and asks for my granting of permissions. When I hit Accept, it should take me back to the app...

Screen #4: ...But instead, it tries to use the Redirect URI, and I get to a page that tells me that "the site" doesn't exist. imgur.com/MSBgM4c

I've been told that it could be a number of issues, including an authentication issue with the WebView in the Android libraries. I've received the following as possible solutions to resolve my problem:

  • 1.) Make sure redirect URI is unique and is not a fully qualified one. For example: http:[slash][slash]android-app is okay, but http:[slash][slash]android-app.com is not.
  • 2.) Make sure device is connected to network with proper DNS configurations. Try opening the URLs in mobile's browser to see if the authentication flow is working
  • 3.) Try different emulator or device with different version of Android.

As for Item 1, I've tried several different URIs (with increasing uniqueness), so I don't think that is the problem. As for Item 2 and Item 3, I've tried a couple different emulators and my phone, and they all used different networks. Has anyone else encountered a similar issue? What would you recommend as a workaround? I have to admit that this problem has become a nuisance, and I would appreciate any help.

Sign In or Register to comment.