Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor Server: How to share data between component and controllers?

$
0
0

From a component I am navigating to an external OAuth2 endpoint that is performing an Authorization Code Flow and then redirects back to my application. The redirection is handled via a dedicated controller. I am now trying to get the authorization code received in the controller into the rest of the application (ideally via services). Since components and controllers run in a different scope I cannot simply inject the scoped service - it will result in a new instance. I wonder what's the best practice to share data between components and controllers? In general, cross-scope communication in Blazor Server seems to be rather tricky and I cannot find much information about it whatsoever.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>