1

Is it supposed to be possible to generate your own JWT within the negotiate function for SignalR Serverless AND have that same JWT passed back to you when the connection event from EventGrid is triggered?

When my EventGridTrigger executes upon a new connection, I get given the UserId which I set, but the AccessToken isn't the one I returned from the negotiate function.

I'm wanting to store extra info in the JWT that can later be accessed when the Serverless SignalR Client Connection Connected event fires, by way of additional claims in the JWT.

JamesD
  • 85
  • 1
  • 5

1 Answers1

0

UPDATE: While the below is true, based on the discussion in this issue, the custom token is not passed to Event Grid. Instead, the recommendation is to use the new upstream feature.

This seems to be implemented in the SignalR Service Extension for Azure Functions. You could try a similar approach.

If you are using Azure Functions, the SignalRConnectionInfoAttribute has properties for the IdToken and ClaimTypeList required for this.

PramodValavala
  • 6,026
  • 1
  • 11
  • 30