tpeczek/Lib.AspNetCore.ServerSentEvents

User Claims is Always Empty

Jarbasjuniorbh opened this issue · 2 comments

Hi, I'm using IServerSentEventsService.GetClients to get specific clients, but the claims is alwas empty;
image

Now if check the User in my controller it's ok:

image

Hi @Jarbasjuniorbh,

This is interesting.

The IServerSentEventsClient.User is basically a passthrough to HttpContext.User. This suggests to me that either the SSE request and controller request are being made with different auth, or the pipeline for both is different.

Of course there can always be a sneaky bug which I'm missing ;).

Can you provide a minimal reproduction? Maybe a modified branch of demo project.

Hi @tpeczek,

Thank you for your reply.
The problem was because I'm using a bearer token and I had to pass it through the headers using polyfills: (https://github.com/Yaffle/EventSource).
Now it's loading the claims ok.
Thank you!