I am trying to pass a bearer token in the header to authorize client connections. The SignalR hub authorizes client by grabbing the bearer token from the header. I cannot modify the SingalR hub code to use a query string to get the token, nor can I use the built-in JWT token functionality.
How do I add a custom header to the SignalR typescript client?
The only thing I can think to do is override the HttpClient in to add the header however I am not sure if this is possible or how to do this.
I am using @microsoft/signalr in Angular 8 and the latest @microsoft/signalr package.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…