-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix service resolution in blazor server #68
Comments
Thanks for this bug report! I've reproduced this locally, so I'm transferring it into AccessTokenManagement's repo. As soon as we have a fix, we can push out a new preview of 3.1. |
@kamil-gorny - looking at this again, I'm not certain if I reproduced exactly the same problem as you had. There is an issue in our sample code, which is that the server side token store keeps tokens in memory, but the store is now scoped and so its collection of tokens gets discarded. Changing ServerSideTokenStore in our BlazorServer sample app to have the tokens be static solves that problem for me:
And I'm able to at least add signalr and continue to use the sample app:
But the errors you saw were a little different so I'm wondering if this will fix it for you to. Can you please try changning the sample's store to have its _tokens be static and let us know how that works? Thanks! |
@josephdecock - To help you better understand the problem, I’ve attached a video that demonstrates the behavior: https://www.youtube.com/watch?v=BIC-ILADqwU&ab_channel=KamilG%C3%B3rny Hopefully, it will provide some useful insights. If you have any further questions or need additional information, please let me know so we can work together to pinpoint the root cause. Looking forward to your thoughts! |
Which version of Duende.AccessTokenManagement are you using?
Latest version pulled directly from the repository.
Which version of .NET are you using?
.NET 8
Describe the bug
When attempting to connect a Blazor Server sample app to Azure SignalR and use Duende AccessTokenManagement, the application throws a NullReferenceException. The issue seems to originate from the BlazorServerUserAccessor, where dependencies like CircuitServicesAccessor and IHttpContextAccessor are null.
To Reproduce
Expected behavior
The application should successfully retrieve the access token and make API calls without throwing exceptions. Dependencies like CircuitServicesAccessor and IHttpContextAccessor should be properly injected.
Log output/exception with stacktrace
Additional context
I’ve tried various debugging approaches but haven’t been able to resolve this. I'm reaching out here because perhaps the creators or others in the community might have insights or ideas on what could be causing this issue and how to fix it
The text was updated successfully, but these errors were encountered: