Azure Active Directory
Google+ Auth
Xamarin Forms, PCL (NuGet 2.4.0.282)
Microsoft.Azure.Mobile.Client 4.0.0 & 4.0.2
After I successfully Login my phone does not return to my app. I have two test phones and one emulator, they display different info, after login.
Phone 1 (Google Auth it greys out and just keeps "loading")

Phone 2 (AAD and Google Auth):

Emulator (AAD and Google Auth):

I have done everything I found here on Stack OverFlow, that makes sense and seems to be applicable to current versions of NuGets. This person seems to be having a similar issue to me but with Google Log in Azure not redirecting after loginenter link description here
I have tried integrating code into my project. And then I input my Azure info into Xamarin's sample: https://github.com/xamarin/xamarin-forms-samples/tree/master/WebServices/TodoAzureAuth
And I get the same results. I have tried both AAD and Google+ Auth. After login it just stays at the browser. So I feel like the client side code has to be correct. But I cant find any mess up on my Azure server code. I have tried this with projects that have a C# and Node.Js backend.(For one of my projects) My ALLOWED EXTERNAL REDIRECT URLS is ToDoList53172://easyauth.callback and in my AndroidManifest.xml looks like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.xamarin.sample.TodoAzure">
<uses-sdk android:minSdkVersion="15" />
<application android:label="TodoAzure" android:icon="@drawable/icon">
<activity android:name="com.microsoft.windowsazure.mobileservices.authentication.RedirectUrlActivity" android:launchMode="singleTop" android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="ToDoList53172" android:host="easyauth.callback" />
</intent-filter>
</activity>
</application>
</manifest>
OLD: And I don't feel like I should post all the other code. It is all in the Xamarin sample project posted above. If people think I should I will. NEW: I am adding more code just to help people out. I did not want to overload, but better to have all the info in one place. So here is my MainActivity.cs Code
using System;
using System.Threading.Tasks;
using Android.App;
using Android.Content.PM;
using Android.OS;
using Microsoft.WindowsAzure.MobileServices;
using Android.Webkit;
namespace TodoAzure.Droid
{
[Activity(Label = "TodoAzure.Droid",
Icon = "@drawable/icon",
MainLauncher = true,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation,
Theme = "@android:style/Theme.Holo.Light")]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity, IAuthenticate
{
MobileServiceUser user;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
global::Xamarin.Forms.Forms.Init(this, bundle);
Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();
App.Init((IAuthenticate)this);
LoadApplication(new App());
}
public async Task<bool> AuthenticateAsync()
{
bool success = false;
try
{
if (user == null)
{
// The authentication provider could also be Facebook, Twitter, or Microsoft
user = await TodoItemManager.DefaultManager.CurrentClient.LoginAsync(this, MobileServiceAuthenticationProvider.Google, Constants.URLScheme);
if (user != null)
{
CreateAndShowDialog(string.Format("You are now logged in - {0}", user.UserId), "Logged in!");
}
}
success = true;
}
catch (Exception ex)
{
CreateAndShowDialog(ex.Message, "Authentication failed");
}
return success;
}
public async Task<bool> LogoutAsync()
{
bool success = false;
try
{
if (user != null)
{
CookieManager.Instance.RemoveAllCookie();
await TodoItemManager.DefaultManager.CurrentClient.LogoutAsync();
CreateAndShowDialog(string.Format("You are now logged out - {0}", user.UserId), "Logged out!");
}
user = null;
success = true;
}
catch (Exception ex)
{
CreateAndShowDialog(ex.Message, "Logout failed");
}
return success;
}
void CreateAndShowDialog(string message, string title)
{
var builder = new AlertDialog.Builder(this);
builder.SetMessage(message);
builder.SetTitle(title);
builder.SetNeutralButton("OK", (sender, args) => { });
builder.Create().Show();
}
}
}
And Like I said above I have tried this with AAD as well. The code above is for Google.
Here is the info I get after logging in with "https://todolistjbb.azurewebsites.net/.auth/login/aad" and then visiting
"https://todolistjbb.azurewebsites.net/.auth/me"

I feel like I have tried SO many things. I have recorded 66.68 hours working on just trying to get Authentication in my app.... please... someone tell me what I am doing wrong! I am losing it over here :'(

