title: Identity Server 4/nativescript Hangs
body: <p>I have the following client:</p>
  
  <pre><code>new Client
  {
      ClientId = "nativeapptest",
      ClientName = "Native App Test",
      Enabled = true,
      RequireClientSecret = false,
      AllowedGrantTypes = GrantTypes.Code,
      RedirectUris = { "com.mysite.nativeapp.12365789785256-buv2dwer7jjjjv5fckasdftn367psbrlb:/home" },
      AllowedScopes =
      {
          IdentityServerConstants.StandardScopes.OpenId,
          IdentityServerConstants.StandardScopes.Profile,
          "MyScope"
      },
      RequirePkce = false,
      AllowOfflineAccess = true,
      RequireConsent = false
  }
  </code></pre>
  
  <p>I am using native-script to build an android app that can log in with Identity Server 4. What currently happens is that I make a request to IS4 by opening a browser and using all the correct OpenID configuration and I end up on the login screen which then I choose to login with Google. Once on google, I enter my email and password and its all good and then Google tries to send me back to my site but it just hangs... Its a white page with nothing loaded and its just sits there forever, there are no error messages logged by is4 as far as I can tell.</p>
  
  <p>The login part above for nativescript is from OAutho2 library <a href="https://www.npmjs.com/package/nativescript-oauth2" rel="noreferrer">https://www.npmjs.com/package/nativescript-oauth2</a></p>
  
  <p>I'm trying to understand would this be a problem on the IS4 or the native Android application. Is the page hanging because it is waiting on the android application to take over having the login have worked? Mabye the problem is with the RedirectURI Scheme?</p>
  
  <p>The URL it hangs on is as follows:</p>
  
  <blockquote>
    <p><a href="http://login.mysite.com/connect/authorize?client_id=nativeapptest&amp;response_type=code&amp;redirect_uri=com.mysite.nativeapp.12365789785256-buv2dwer7jjjjv5fckasdftn367psbrlb%3A%2Fhome&amp;scope=openid%20profile%20MySite&amp;response_mode=query&amp;st" rel="noreferrer">http://login.mysite.com/connect/authorize?client_id=nativeapptest&amp;response_type=code&amp;redirect_uri=com.mysite.nativeapp.12365789785256-buv2dwer7jjjjv5fckasdftn367psbrlb%3A%2Fhome&amp;scope=openid%20profile%20MySite&amp;response_mode=query&amp;st</a></p>
  </blockquote>
  
  <p>EDIT: </p>
  
  <p>Since I'm running this on the actual server, I can't debug it directly, however, I did add logs to see how far the code goes. My logs tell me that the user was logged in by google and my system and my logs also show that ExternalCallback has redirected the page to </p>
  
  <blockquote>
    <p>/connect/authorize/callback?client_id=nativeapptest&amp;response_type=code&amp;redirect_uri=com.mysite.nativeapp%3A%2F%2Fhome&amp;scope=openid%20profile%20MyScope&amp;response_mode=query&amp;state=abcd</p>
  </blockquote>
  
  <p>At this point, the page hangs.</p>
  
  <p>Please note that we changed RedirectUri to com.mysite.nativeapp to help with testing.</p>
  
  <p>Lastly, I'm not sure if it matters, but we are not using https as this is still development phase.</p>