Open sommmen opened 1 year ago
Thanks for the interesting feature request. It would be useful to be able to skip entering the JWT. However, to realize this feature in 'TypedSignalR.Client.DevTools' will take time as it needs to be well considered and designed.
Okay when I have some time I might take a crack at this.
Hello,
Cool tools for SignalR you have here!
I don't really want to have to input my jwt token everytime im refreshing, it would be cool to allow for the token to come from a cookie or something. In other words; to have the dashboard automatically log in with a token.
I'm using other development related dashboarding libraries, so i'll detail how i got this working below. Basically my front-end manages an access token and saves it into local storage. Then i have various ways of loading that token into third party dashboards.
Swagger (NSwsag)
Needs no introduction.
The front end sets a cookie called
token
. And then i inject a custom js script into the dashboard of swagger. This sets the AT in a local storage item.authservice.ts
Startup.cs
custom.js:
Hangfire (background job scheduling)
https://docs.hangfire.io/en/latest/configuration/using-dashboard.html
The dashboard uses a simple cookie to save the JWT bearer so my Front-end simply sets the cookie via JS.
Serilog-ui (web view for the serilog logging library)
https://github.com/serilog-contrib/serilog-ui
I actually implemented parts of this feature myself in serilog-ui. In this case we set the token in session storage from the front-end, but also allow fetching the cookie (because why not) via custom script.
authservice.ts
startup.cs
custom.js
Proposal
Let me know if this is something you'd be interested in. It would sure help me out.