ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#โ€ข4y agoโ€ข
4 replies
Dusty

Blazor WASM Authentication with separate APIs

I have a Blazor WASM app and an API for that client app. Now I'd like to decouple things and extract the authentication layer into it's own project an API.

So I'd have 4 projects (in reality there're also Domain, Infrastructre etc. projects but for the sake of this example I wanna keep it simple):
- MyProject.BlazorClient
- MyProject.HostApi
- MyProject.Shared (would contain Models, DBContext etc.)
- MyProject.Authentication.Api (should basically act like auth0 and manage authentication)

Purpose/use case:
I would like to have a centralized authentication API like
accounts.myproject.tld
accounts.myproject.tld
which could be used for other services on that domain like
service1.myproject.tld
service1.myproject.tld
and
service2.myproject.tld
service2.myproject.tld
without the need of 2 separate authentication providers. So like I said, basically a "self hosted auth0".

Questions:
1. Are there any examples/tutorials/references of this available? Can't seem to find any and I don't want to reinvent the wheel ๐Ÿ˜…
2. How can I secure my HostApi with the authentication server?
3. How can I implement authentication with this pattern in blazor?
Do I need to configure the Blazor WASM app to use one API for authentication and another one for data retrieval? If so, how?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Blazor WASM Authentication
C#CC# / help
2y ago
WebAPI authentication with Blazor WASM
C#CC# / help
8mo ago
Blazor Wasm with blazor server or API
C#CC# / help
3y ago
โ” Blazor wasm with custom styles
C#CC# / help
3y ago