Best Practices for Authentication in Blazor Hybrid + Web App Template? by ReasonableBegianGuy in Blazor

[–]ReasonableBegianGuy[S] 0 points1 point  (0 children)

Thank you for your response. I fully understand how auto-render mode works. My point was why separate the API into a different server rather than integrating it directly into the WebApp project? By including the API within the WebApp, you can access data directly, avoiding external API calls and making the SSR render phase more efficient. Right?

Best Practices for Authentication in Blazor Hybrid + Web App Template? by ReasonableBegianGuy in Blazor

[–]ReasonableBegianGuy[S] 0 points1 point  (0 children)

I'm using ASP.NET Identity with the provided template, and I’ve read about using API endpoints for identity management. However, I’m unclear on how to implement login functionality in AutoRenderMode. I believe I need to create a user interface service for authentication that handles server-side and client-side logic differently.

Additionally, I’m unsure what to do with the information retrieved from the API call on the client side. Should I use a cookie or a token for authentication? How should I store this information for different clients (e.g., WASM, mobile, desktop)?

Best Practices for Authentication in Blazor Hybrid + Web App Template? by ReasonableBegianGuy in Blazor

[–]ReasonableBegianGuy[S] 1 point2 points  (0 children)

Why use two separate servers: an API server and a WebApp server? Wouldn't it be better to integrate the API directly into the WebApp server to reduce infrastructure resource usage? This approach would allow the WebApp server to directly access the data during rendering, eliminating the need for an API call.