title: Autodesk Forge: In 3-legged "Authorize application" screen: Allow-button does not respond
body: <p>I wanted to create a 3-legged OAuth on (C#) desktop for Autodesk forge. I based my app on the article <a href="https://forge.autodesk.com/cloud_and_mobile/2016/10/3-legged-oauth-on-desktop-apps-c-winform.html" rel="nofollow noreferrer">3-legged OAuth on desktop apps (C# &amp; WinForm)</a>. When I run my program, it lets me enter my username and then my password. But when it comes to &quot;Authorize application&quot;, it does not react when I press the &quot;Allow&quot;-button. It turns dark blue when I hover over it but doesn't respond to any click.</p>
  <p>I use ngrok to &quot;capture&quot; the Callback.</p>
  <p><a href="https://i.stack.imgur.com/TY8s8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TY8s8.png" alt="enter image description here" /></a></p>
  <pre><code>    [PermissionSet(SecurityAction.Demand, Name = &quot;FullTrust&quot;)]
      public partial class oAuthForm : Form
      {
          private const string FORGE_CLIENT_ID = &quot;abcdefghijklmnopqrstuvwxyz&quot;;
          private const string FORGE_CLIENT_SECRET = &quot;zyxwvutsrqp&quot;;
          private const string FORGE_CALLBACK_URL = &quot;https://bff25109c9dc.ngrok.io&quot;;
          private const string FORGE_BASE_URL = &quot;https://developer.api.autodesk.com&quot;;
          private const string FORGE_SCOPE = &quot;data:read data:write data:create data:search bucket:create bucket:read bucket:update bucket:delete&quot;; // assuming a full scope
  
          private WebBrowser2 wb = new WebBrowser2();
  
          public oAuthForm()
          {
              InitializeComponent();
  
              wb.Dock = DockStyle.Fill;
              wb.NavigateError += new WebBrowserNavigateErrorEventHandler(wb_NavigateError);
              Controls.Add(wb);
  
              // this is a basic code sample, quick &amp; dirty way to get the Authentication string
              string authorizeUrl = FORGE_BASE_URL + string.Format(&quot;/authentication/v1/authorize?response_type=code&amp;client_id={0}&amp;redirect_uri={1}&amp;scope={2}&quot;, FORGE_CLIENT_ID, FORGE_CALLBACK_URL, WebUtility.UrlEncode(FORGE_SCOPE));
  
              // now let's open the Authorize page.
              wb.Navigate(authorizeUrl);
          }
  
          private void wb_NavigateError(object sender, WebBrowserNavigateErrorEventArgs e)
          {
              // This will track errors: we want to track the 404 when the login
              // page redirects to our callback URL, let's check if is the error
              // we're tracking.
              Uri callbackURL = new Uri(e.Url);
              if (e.Url.IndexOf(FORGE_CALLBACK_URL) == -1)
              {
                  MessageBox.Show(&quot;Sorry, the authorization failed&quot;, &quot;Error&quot;, MessageBoxButtons.OK, MessageBoxIcon.Error);
                  return;
              }
  
              // extract the code
              var query = HttpUtility.ParseQueryString(callbackURL.Query);
              string code = query[&quot;code&quot;];
  
              // now we have the code, let's make a Http call to 
              // /authentication/v1/gettoken 
              // and get the access_token...
  
              // you can use RestSharp for it, but I'll stop the sample here
  
              // you may want to close this form..
              this.Close();
          }
      }
  </code></pre>
  <p>The Visual Studio solution can be found <a href="https://bertildegroot0279@dev.azure.com/bertildegroot0279/Forge_3legged/_git/Forge_3legged" rel="nofollow noreferrer">here</a>.</p>