These great articles work well individually, but I'm struggling to get them working together, in that I'd like the signalr hub to know who the logged in member is. Accessing Context?.User?.Identity?.Name returns null.
I've tried creating a token generation endpoint and passing that into the accessTokenFactory of the signalr hub builder on the client, but not had much luck. The asp.net core identity docs say that signalr should pick up the default identity cookie automatically (https://learn.microsoft.com/en-us/aspnet/core/signalr/authn-and-authz?view=aspnetcore-8.0#cookie-authentication), so wondering if I am missing some
bit of config (the MS docs on this are a bit of a maze).
Websockets mapped to /umbraco/<hub> will use backoffice auth, and sockets mapped to /<hub will use front end user auth. As soon as I changed my hub route, all was good!
Reading member Identity in SignalR hub.
I was wondering if anyone could help me. I've been following along with the example to create a signalr hub on https://docs.umbraco.com/umbraco-cms/implementation/custom-routing/signalr (using 13LTS version), and also to setup member registration https://docs.umbraco.com/umbraco-cms/tutorials/members-registration-and-login.
These great articles work well individually, but I'm struggling to get them working together, in that I'd like the signalr hub to know who the logged in member is. Accessing Context?.User?.Identity?.Name returns null.
I've tried creating a token generation endpoint and passing that into the accessTokenFactory of the signalr hub builder on the client, but not had much luck. The asp.net core identity docs say that signalr should pick up the default identity cookie automatically (https://learn.microsoft.com/en-us/aspnet/core/signalr/authn-and-authz?view=aspnetcore-8.0#cookie-authentication), so wondering if I am missing some bit of config (the MS docs on this are a bit of a maze).
If anyone could help that would be great.
Figured it out.
Websockets mapped to
/umbraco/<hub>
will use backoffice auth, and sockets mapped to/<hub
will use front end user auth. As soon as I changed my hub route, all was good!is working on a reply...