I've been trying to solve this issue for over a week now with no progress whatsoever. I’m having trouble authenticating using Cordova Azure Mobile App plugin and .NET/C# back-end. 

I'm following this [tutorial](https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-cordova-get-started/) on creating a Cordova app for Android/iOS. I added Azure Active Directory as my provider for authentication based on this [tutorial](https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-cordova-get-started-users/). I downloaded the quickstart projects from the Azure Portal for Cordova and .NET/C# back-end.

I deployed the Azure mobile app back-end and updated the Resource Explorer to allow <https://localhost:4000> and https://{myazurewebsite}.azurewebsites.net by adding the URL’s in allowedExternalRedirectUrls. I also updated CORS to allow those same URL’s. I added my Single Sign-On Reply URL to be https://{myazurewebsite}.azurewebsites.net/.auth/login/aad/callback. I ensured that my Cordova app has the InAppBrowser and [Azure Mobile Apps](https://www.npmjs.com/package/cordova-plugin-ms-azure-mobile-apps) plugin installed. I updated the Content-Security-Policy to point to <https://login.windows.net> and https://{myazurewebsite}.azurewebsites.net. I updated my onDeviceReady() function to be:

```
function onDeviceReady() {

    // Create a connection reference to our Azure Mobile Apps backend
    client = new WindowsAzure.MobileServiceClient('https://{myazurewebsite}.azurewebsites.net');

    // Login to the service
    client.login('aad')
        .then(function () {

            // BEGINNING OF ORIGINAL CODE

            // Create a table reference
            todoItemTable = client.getTable('todoitem');

            // Refresh the todoItems
            refreshDisplay();

            // Wire up the UI Event Handler for the Add Item
            $('#add-item').submit(addItemHandler);
            $('#refresh').on('click', refreshDisplay);

            // END OF ORIGINAL CODE

        }, handleError);
}

```

When I execute the Cordova app in Ripple *while connected to my* **work LAN**, the app loads into Ripple and then a second window opens asking me for my AAD credentials. I enter my username, tab off, and the redirect starts to happen and I am successfully authenticated and able to interact with the ToDoItems from the tutorial.

When I execute the Cordova app in Ripple *while connected to a* **public network**, the app loads into Ripple and then a second window opens asking me for my AAD credentials. I enter my username, tab off, and the redirect starts to happen and the I am presented with an additional prompt shown in the image below:

[![enter image description here](https://i.stack.imgur.com/WJmpu.png)](https://i.stack.imgur.com/WJmpu.png)

When I execute the Cordova app and send it to an Android or iOS device *while connected* to a **public network**, I receive the Cordova WebView (InAppBrowser) which asks for my credentials. I enter my username, press the password text box, and the redirect starts. It then just goes to a blank white page and hangs there.

Am I missing something? Why do I get a second prompt in Ripple when connected to a public network and why does the Cordova WebView show a blank screen after trying to authenticate the user name only?

Azure Mobile App CORS settings:
[![enter image description here](https://i.stack.imgur.com/79SbY.png)](https://i.stack.imgur.com/79SbY.png)

Azure Mobile App AAD Authentication settings
[![enter image description here](https://i.stack.imgur.com/vMlFW.png)](https://i.stack.imgur.com/vMlFW.png)

Azure Resource Explorer settings:
[![enter image description here](https://i.stack.imgur.com/Fw3kB.png)](https://i.stack.imgur.com/Fw3kB.png)

Azure Active Directory WebApp created by **Express** setting Active Directory Management Mode
[![enter image description here](https://i.stack.imgur.com/aSnbL.png)](https://i.stack.imgur.com/aSnbL.png)
*The delegate permission set is the default one: Sign in and read user profile*