title: How to implement SSO with PublicClientApplicationBuilder and Unity/HoloLens 2
body: <p>What I get is an interactive OAuth2.0 token to use it for dataverse. What I want is SSO for it so I don't need to write my E-Mail and Password.</p>
  <p>I saw that you can use &quot;.WithBroker(true)&quot; but it's not compatible with Unity.</p>
  <pre><code>        public async void TokenGen()
      {
          var app = PublicClientApplicationBuilder.Create(secrets.clientid)
              //.WithAuthority(AzureCloudInstance.AzurePublic, secrets.tenantid)
              //.WithRedirectUri(&quot;https://login.microsoftonline.com/common/oauth2/nativeclient&quot;)
              .WithBroker(true)
              .Build();
  
          var accounts = await app.GetAccountsAsync();
          var accountToLogin = PublicClientApplication.OperatingSystemAccount;
          #if !UNITY_EDITOR
          // returns smth like S-1-15-2-2601115387-131721061-1180486061-1362788748-631273777-3164314714-2766189824
          string sid = WebAuthenticationBroker.GetCurrentApplicationCallbackUri().Host.ToUpper();
  
          // the redirect uri you need to register
          string redirectUri = $&quot;ms-appx-web://microsoft.aad.brokerplugin/{sid}&quot;;
  
          Debug.Log(redirectUri);
          #endif
          try
          {
              
              authResult = await app.AcquireTokenSilent(scopearray, accountToLogin)
                  .ExecuteAsync();
              
              
          }
          catch (MsalUiRequiredException ex)
          {
              var authResult = await app.AcquireTokenInteractive(scopearray)
                  .WithAccount(accountToLogin)
                  .ExecuteAsync();
  
             
              Debug.Log($&quot;MsalUiRequiredException: {ex.Message}&quot;);
              authResult = await app.AcquireTokenInteractive(scopearray)
                  .ExecuteAsync()
                  .ConfigureAwait(false);
  
  
  
              Debug.Log(&quot;Token Interactive&quot;);
            
          }
  </code></pre>
  <p>Error: PlatformNotSupportedException: The Windows broker is not directly available on MSAL for .NET Framework To use it, please install the nuget package named Microsoft.Identity.Client.Desktop and call the extension method .WithWindowsBroker() first.</p>
  <p>Any ways to implement it?</p>
  <p>thanks</p>