universalappco
Help for Creating a Maui Application with Asp.net API and SQL Server Database Integration
In that case then it should be fairly easy.
I haven't used the new token endpoints, but in .NET 8 there's built in endpoints for Token Based authentication, and it's only about 2 lines to add this on top of cookie-based auth that the web front-end uses.
Before .NET 8 it was possible to mix the two already, but the new endpoints make it even easier (but come with some caveats that @Kratos should consider)
@Kratos you already have .AddIdentityApiEndpoints() and .MapIdentityApi() in your program.cs so you're already setup to use these endpoints if they're suitable. From your MAUI app just use HttpClient to call the endpoints:
This article will get you started
https://andrewlock.net/exploring-the-dotnet-8-preview-introducing-the-identity-api-endpoints/
30 replies
Help for Creating a Maui Application with Asp.net API and SQL Server Database Integration
Have you started your project? If you're able to share your code I may have some time to help get you started.
Are you using .NET Identity (Usernames stored in a database), or external identity providers such as Azure/Entra (Microsoft Identity Framework)?
30 replies
Blazor Wasm with blazor server or API
Blazor Server requires a constant websocket connect for interactivity. The UI changes are rendered on the server and then the DOM elements replaced on the page.
WASM runs fully in the browser. If you want to offload processing to the users browser WASM can be a good choice, it should give the fastest experience on capable hardware. It's a lot closer to developing mobile or windows apps in a lot of ways.
In the new "Blazor Web App" Template I would store anything that needs to run in Auto or WASM rending mode in the Client project that is created for you - As you pointed out, when running WASM you need to call to your backend API to save changes to the database etc.
If a component has a lot of interactivity that would benefit from running client side, you might prefer that over Blazor Server rendering.
3 replies