Reputation: 334
I'm attempting to build a small sample Blazor Maui app which authenticates the user with identity server. I'm trying to get to the point where I can login from the Maui app and then, whenever I use the blazorWebview component, the authentication state of the user can be accessed for Auth decisions.
At the moment I have the identity server login flow setup in a razor component in the Maui app, which completes the login flow.
Now I want to be able to pass that login state / principal information to the Blazor web view to use in components (some of which are referenced in an external class library). Has anyone had luck with doing this?
(Ps. I have followed the Microsoft Docs here to implement my own Custom Authentication State Provider, and added it to dependency injection but there is no instructions on how this would carry authentication information across to the Blazor web view).
Upvotes: 6
Views: 3778
Reputation: 1
Here's a repo that should help with your question.
This sample shows how to use the IdentityModel.OidcClient FOSS library to connect a .NET MAUI Blazor app to IdentityServer
start browser-based authentication flows, which listen for a callback to a specific URL registered to the app.
Upvotes: -1