Asp .net core 3.1 JWT and SignalR authentication login part

Viewed 1089

I'm new with SignalR and I am using both ASPNET Core 3.1 in server and client(console app).

I tried to make login part which provides to user his token, since token has short lifespan, it needs to be regenerated.

I followed this example: https://docs.microsoft.com/en-us/aspnet/core/signalr/authn-and-authz?view=aspnetcore-3.1 but I missed part where server gives client his new token.

Do I need to make Http call to server to get token and/or renew it or SignalR it somehow manages to get token and renew it, please explain me this.

Thank you.

1 Answers

Yes, you have to Authenticate first, and then, before your token expired, you should refresh the token with another request.

After you get the new token from your server, use should use it for every new SignalR connection that you will do.

See @JasonWatmore relative article for more info.

Related