title: To authenticate .NET Core 3.0 WPF desktop client with AD B2C, how to use the Default OS Browser?
body: <p>I am creating a new WPF .NET Core 3.0 app, using <code>Microsoft Identity Client (4.0.0)</code>, and want to authenticate using AD B2C to gain access to a Web API. </p>
  
  <p>I have registered the app with the AD B2C tenant. But the call to <code>AcquireTokenInteractive</code> is throwing an exception indicating </p>
  
  <blockquote>
    <p>"Only loopback redirect uri is supported, but
    urn:ietf:wg:oauth:2.0:oob was found. Configure <a href="http://localhost" rel="nofollow noreferrer">http://localhost</a> or
    <a href="http://localhost:port" rel="nofollow noreferrer">http://localhost:port</a> both during app registration and when you create
    the PublicClientApplication object. See
    <a href="https://aka.ms/msal-net-os-browser" rel="nofollow noreferrer">https://aka.ms/msal-net-os-browser</a> for details".</p>
  </blockquote>
  
  <pre><code>// Creation of PublicClientApp
  // Call to WithRedirectUri is commented out because that redirect URI cannot
  // be added during app registration. 
  public static IPublicClientApplication PublicClientApp { get; } = PublicClientApplicationBuilder.
      Create(ClientId).
      WithB2CAuthority(Authority).
      // WithRedirectUri("http://localhost").
      Build();
  </code></pre>
  
  <pre><code>// Sign-in method logic
  await App.PublicClientApp.AcquireTokenInteractive(App.ApiScopes).
      WithB2CAuthority(App.Authority).
      WithPrompt(Prompt.SelectAccount).
      ExecuteAsync();
  </code></pre>
  
  <p>On the AD B2C app registration I cannot add custom URI "<a href="http://localhost" rel="nofollow noreferrer">http://localhost</a>". Is this scenario not supported? What other options can I use?</p>
  
  <p>Here is the Azure portal AD B2C tenant app registration screen for native client
  <a href="https://i.stack.imgur.com/TOtTD.png" rel="nofollow noreferrer">Native app registration screen shot</a></p>