Reputation: 23
So much has changed since I last did any development so please bear with me,
Been picking up C# in assisting bug hunting in a server-hosted application, before this it was Java for IRC bots and PHP 5.6. (Oof, I just made myself feel old)
I've been building my knowledge and reading various tutorials and Microsoft Documentation (Which has caused me so much more confusion as to what I need/want) that I want to settle on a RESTful data flow like the image below.
I found tutorials (Example from Pragim - I followed the text, not videos) and it talks about ASP.Net Core Identity on the Blazor Server level. To me, it makes more sense to move it to the RESTful server (Which I now understand use the ASP.Net WebAPI) level, since I want to be able to later develop different front end, for example, a front end Android app later on and still maintain the same backend for authorization, authentication, and data management.
I've looked around for more tutorials and found Securing Client-Side Blazor with WebApi tutorial but it talks about Blazor WebAssembly. I'm feeling overloaded with too much information.
I want to provide a loosely coupled Management System to help me manage my first responder volunteer unit. Unit members would use the system for tracking their hours, seeing and tracking certification expiry, leadership in various roles and levels would use it to see reports of hours, sending notification in the chain of command way, and other features I feel the system needs. Similar to an employee management system.
There's also a possibility of growing from my local unit of up to 50 members, to a council of 3-5 units, and a rare possibility of nationwide hence my need to be loosely coupled as the tech at different levels may need to be swapped out although that's beyond the scope of current development, the scope is to learn and have a working system for my unit, I feel the need to design in a way that growing/adapting is easier.
My understanding of Blazor WebAss vs Blazor Server hosting is that WebAss download all of the logic, while the Server rendered the content on the server-side and only the change is sent and I went with the server since it could be accessed via devices that are on wireless access like 4G, etc and reducing bandwidth and processing usage is key. I am settled on using ASP.Net, C# as full-stack as I can. Blazor Server and Web API are separate but locally hosted.
==============
How to use Blazor Server Hosted to access WebAPI server to authenticate/authorize? Is it even possible to allow sign up with external services like Google, Microsoft, and Facebook with this setup?
Upvotes: 1
Views: 1808
Reputation: 1112
The short answer is Yes, you can call external API's in the same app, use Identity and Identity already has the ability to authenticate via google/ms/fb.
However Blazor server is prone to latency(it would matter where the server is) and requires a decent connection. I would question its place here.
Blazor webassembly is a client side UI framework and it would be easier later if you where inclined to removed it as your webapi is separate.
Upvotes: 1