Redirect to UWP app from OAuth without ms-app

Viewed 1386

I'm trying to write an app that communicates with an OAuth URL. Communication with the OAuth URL behaves appropriately, and the user is correctly prompted to log in. However, due to restrictions in the redirect URL for the app, I am unable to redirect to an ms-app domain (which I believe is how you open a UWP app on Windows 10 - please correct me if this assumption is incorrect!).

Other than hosting my own website and having a redirect created, does anyone know how to do this?

The code I'm currently using for the client is the sample code:

try
{
    var webAuthenticationResult = await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None, url);

    switch (webAuthenticationResult.ResponseStatus)
    {
        case WebAuthenticationStatus.Success:
            // Successful authentication. 
            result = webAuthenticationResult.ResponseData.ToString();
            break;

        case WebAuthenticationStatus.ErrorHttp:
            // HTTP error. 
            result = webAuthenticationResult.ResponseErrorDetail.ToString();
            break;

        default:
            // Other error.
            result = webAuthenticationResult.ResponseData.ToString();
            break;
    }
}
catch (Exception ex)
{
    // Authentication failed. Handle parameter, SSL/TLS, and Network Unavailable errors here. 
    result = ex.Message;
}

The issue manifests itself like this:

Error reads: "We can't connect to the service you need right now. Check your network connection or try this again later."

2 Answers
Related