Getting an error with Instagram when trying to authenticate
<p>In a Universal Windows App (UWP), I'm trying to log the user into his/her Instagram account, but have no luck. I keep getting the following error after the user enters their credentials and pressed the login button:</p>

<p><a href="https://i.stack.imgur.com/gfHm5.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/gfHm5.jpg" alt="enter image description here"></a></p>

<p>Here is the code being used:</p>

<pre><code>var scopes = new List&lt;OAuth.Scope&gt;();
scopes.Add(InstaSharp.OAuth.Scope.Basic);

var link = InstaSharp.OAuth
                .AuthLink
                (
                    _config.OAuthUri + "authorize",
                    _config.ClientId,
                    _config.RedirectUri,
                    scopes,
                    InstaSharp.OAuth.ResponseType.Token
                );

var webAuthResult = await WebAuthenticationBroker
                                .AuthenticateAsync
                                (
                                    WebAuthenticationOptions.None,
                                    new Uri(link)
                                );

switch (webAuthResult.ResponseStatus)
{
    case WebAuthenticationStatus.Success:
        return true;

    case WebAuthenticationStatus.UserCancel:
        return false;

    case WebAuthenticationStatus.ErrorHttp:
        return false;

    default:
        return false;
}
</code></pre>

<p>Am I doing something wrong??</p>

<hr>

<h2>UPDATE 1:</h2>

<hr>

<p>Here is a UWP quick sample that demonstrates the issue:</p>

<p><a href="https://1drv.ms/u/s!AkM_7yXYPcncmYcVK2GvxQ9MQuStGQ" rel="nofollow">UWP SAMPLE</a></p>

<hr>

<h2>UPDATE 2:</h2>

<hr>

<p>I found the problem that caused the "cannot connect to service" error. Here was the code that caused the problem:</p>

<pre><code>        _config = new InstagramConfig(clientIdTextBox.Text,
                                clientSecretTextBox.Text,
                                WebAuthenticationBroker.GetCurrentApplicationCallbackUri().ToString(),
                                WebAuthenticationBroker.GetCurrentApplicationCallbackUri().ToString());
</code></pre>

<p>My 3rd parameter, the Redirect Url, is not a web address, but an application link. If I were to change that to a simple Url like www.instagram.com, then it works, HOWEVER the browser stays open on that redirect url.</p>

<p>How do I make the browser <strong>redirect back to my UWP app</strong> using the redirect Url ???</p>