title: SignalR Error 405 (method not allowed) - Negotiate
body: <p>here below my envirovment:</p>
  
  <ul>
  <li>Web Client Javascript with <strong>Mvc .NetCore 2.2</strong></li>
  <li>WebAPI in <strong>Web api .Net Core 2.2</strong></li>
  <li>AzureAd Authentication with openid </li>
  </ul>
  
  <p>We have some trouble with SignalR connection.</p>
  
  <p>With the <strong>Attempt 1</strong> we are able to use correctly signalR in our development environment (localhost), but when we deploy it in production we received the error: </p>
  
  <p>"<strong>WebSocket connection to 'wss://xxxxxxxxx:60000/PushNotificationHub?access_token=' failed: Error during WebSocket handshake: Unexpected response code: 400</strong>"</p>
  
  <p><strong>Attempt 1</strong></p>
  
  <pre><code>connessioneServizioChat = new signalR.HubConnectionBuilder().withUrl(puntatori.url.applicazioneApiCore + "PushNotificationHub", {
              accessTokenFactory: () =&gt; sicurezza.dati.tokenAutenticazioneWebApi,
              skipNegotiation: true,
              transport: signalR.HttpTransportType.WebSockets
          }).build();
  </code></pre>
  
  <p>So we are trying to avoid the "websocket" transport type with the solution below:</p>
  
  <pre><code> connessioneServizioChat = new signalR.HubConnectionBuilder()
              .withUrl(puntatori.url.applicazioneApiCore + "PushNotificationHub")
              .configureLogging(signalR.LogLevel.Information)
              .build();
  </code></pre>
  
  <p>In this case we have an issue in the development environment too:</p>
  
  <p><strong>signalrNew.min.js:16 OPTIONS <a href="https://localhost:60000/PushNotificationHub/negotiate" rel="nofollow noreferrer">https://localhost:60000/PushNotificationHub/negotiate</a> 405 (Method Not Allowed)</strong></p>
  
  <p>We don't understand WHAT is the negotiate method and how to solve our issue.</p>
  
  <p>Can someone help us?</p>
  
  <p>Thank you</p>