title: What response is AppAuth looking for to close the browser window and complete request?
body: <p>I am trying to use AppAuth to get an auth code from Instagram, redirect to my server, and exchange that auth code for a custom Firebase token. I'm having problems passing data to AppAuth and triggering the browser window to close.</p>
  
  <p><strong>What works so far</strong></p>
  
  <ol>
  <li>Mobile app registers a custom scheme, <code>myscheme:/</code></li>
  <li>AppAuth hits Instagram authorize endpoint, receives valid <code>code</code>, redirects to <code>https://myserver.com</code></li>
  <li>AppAuth hits <code>https://myserver.com</code>, provides <code>code</code>, is waiting for response</li>
  <li>My server hits Instagram token endpoint, exchanges <code>code</code>/etc for valid <code>token</code></li>
  <li>My server uses this <code>token</code> to mint a valid <code>Firebase token</code></li>
  </ol>
  
  <p>At this point AppAuth browser window is open and waiting for a response from my server. The server has the <code>Firebase token</code>. The desired next step is to provide this token to AppAuth and have AppAuth close the browser window and complete the process.</p>
  
  <p><strong>What I've tried:</strong></p>
  
  <ol>
  <li>Return a redirect to <code>myscheme:/instagram?token=Firebase token</code></li>
  </ol>
  
  <p>This closes the AppAuth browser window but the process does not complete so AppAuth does not return any result. It continues to wait even though the browser window is closed.</p>
  
  <ol start="2">
  <li>Setup a custom scheme listener and redirect to <code>myscheme:/instagram?token=Firebase token</code></li>
  </ol>
  
  <p>This has the same outcome as 1. but the custom scheme listener does not capture this event, and even if it did, I have no way to cancel the AppAuth process. This feels hacky at best.</p>
  
  <p><strong>To distill the question further:</strong></p>
  
  <p>What does AppAuth need to close the browser window and complete the handshake? What is it looking for?</p>