Question about ServiceStack Auth on .NET Maui Blazor Hybrid #105
-
When implementing a .NET Maui Blazor Hybrid application intended to run on IOS/Android/Windows (reusing razor libraries for a web solution as well), I would love to use the great work that ServiceStack has done over the years to build up browser-based authentication flows for Apple, Google and Microsoft (using OpenID Connect/oAuth 2). A recent Blazor Tailwind demo showed a plethora of UI controls around authentication-centered functionality - but I see that uses the ASP.NET Identity Platform - and it seems that this is the recommended approach for ServiceStack apps going forward...is that the case? It adds additional complexity to the solution, since I am using OrmLite (rather then Entity Framework - and it seems a little messy to have 2 ORMs and 2 intertwined migration stories in a single app). What are your thoughts on all of that? Also: the Blazor Web App Demo shows a solution which leverages the unified blazor hosting model for .NET 8. Would it be easy to port those wonderful identity controls over to a .NET MAUI Blazor Hybrid solution (where the server-part/API of the solution would be in a different project) so that I could use a browser-based authentication flow on startup of my app on Android/iOS/Windows? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
That is the case, the easiest way to get a supported Auth Story that works in all of Blazor's Render Modes was to adopt ASP.NET Core Identity Auth and reuse all their existing Auth Integrations in the default Blazor templates.
Using Entity Framework for the Identity User Models is effectively mandated in order to make use of all the existing functionality around ASP.NET Core Identity Auth and Identity UI. We also use OrmLite for the rest of the Application, and whilst there are 2 migrations solutions, OrmLite's migrations are more flexible which can perform schema and data migration updates that's also able to run Entity Framework's migrations so you still have a single command to setup a database after creating a schema and running both EF and OrmLite migrations, e.g:
We no longer have full control over Auth which limits what features we can add, but at least all .NET Apps now use the same Auth Provider model to secure their Apps which stands a better chance for someone having documented a similar Auth workflow to what you want to do.
I've honestly not looked at Maui Hybrid, which I thought was an Application around a Web View control in which case I would have thought all Blazor Components would be able to work as-is. But I don't really see MAUI gaining much momentum so I don't want to spend any time supporting it. |
Beta Was this translation helpful? Give feedback.
That is the case, the easiest way to get a supported Auth Story that works in all of Blazor's Render Modes was to adopt ASP.NET Core Identity Auth and reuse all their existing Auth Integrations in the default Blazor templates.
Using Entity Framework for the Identity User Models is effectively mandated in order to make use of all the existing fu…