You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
// serilog-ui. Since this uses a session, this should be opened on the same page, or else this won't work.sessionStorage.setItem('serilogui_token',`Bearer ${auth.token}`)
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.
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.
The text was updated successfully, but these errors were encountered: