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.
↧