You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is never called.
The signalr js lib has the ability to include headers in the setup, although that feature was added in a later version to what this demo is currently using.
Delete getAxiosConfig, update the signalr client library, and use:
was passing empty string for the userId param, and yet somehow, a username was still being populated. I believe this was happening via the http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier claim. Passing null, or, with point 1 fixed, passing a username, seemed to cause a
Invocation failed, status code 500
error when calling any hub method after negotiating.
Updating the signalr-service-extension C# library version to latest fixed that issue
It took me some time to understand how the jwt was used in this sample. One is created in the frontend and signed with the key myfunctionauthtest, no checking is performed on the backend, and the key is not shared. For a real-life app I wanted to use an Active Directory token containing multiple groups claims - where I ran into this issue: Multiple jwt claims of the same type not supported? Azure/azure-functions-signalrservice-extension#260. That aside, I believe the correct workflow is to verify my token in the Negotiate function, then add the claims I want to refer to later via return Negotiate(name, claims). These claims are sent to the signalr service via a new jwt signed with the signalr access key
It also took me a while to understand that the hub methods are called by the azure signalr service, and therefore won't work locally. There's a signalr serverless emulator available here: https://github.com/Azure/azure-signalr/blob/dev/docs/emulator.md for local development. Perhaps it could be mentioned in this documentation?
I worked through the BidirectionChat sample and encountered a few errors and omissions, so I thought I'd list them for the next person:
x-ms-signalr-user-id
is never sent from the frontend. The functionAzureSignalR-samples/samples/BidirectionChat/csharp/content/index.html
Lines 173 to 178 in bb7652a
is never called.
The signalr js lib has the ability to include headers in the setup, although that feature was added in a later version to what this demo is currently using.
Delete
getAxiosConfig
, update the signalr client library, and use:AzureSignalR-samples/samples/BidirectionChat/csharp/Function.cs
Lines 32 to 34 in bb7652a
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier
claim. Passing null, or, with point 1 fixed, passing a username, seemed to cause aerror when calling any hub method after negotiating.
Updating the signalr-service-extension C# library version to latest fixed that issue
myfunctionauthtest
, no checking is performed on the backend, and the key is not shared. For a real-life app I wanted to use an Active Directory token containing multiplegroups
claims - where I ran into this issue: Multiple jwt claims of the same type not supported? Azure/azure-functions-signalrservice-extension#260. That aside, I believe the correct workflow is to verify my token in the Negotiate function, then add the claims I want to refer to later viareturn Negotiate(name, claims)
. These claims are sent to the signalr service via a new jwt signed with the signalr access keyThe text was updated successfully, but these errors were encountered: