Role based authentication clean architecture example
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amira BedhiafiRank #601 · 4K reputationPosted Aug 3, 2025, 1:29 PM EDT
Hello Sangeetha !
The clean architecture separates your application into layers:
Role-based authentication typically goes in the application layer for policy logic and Infrastructure for identity providers (like JWT or Identity Server).
You can find an example in Git that includes role-based auth using ASP.Net identity and JWThttps://github.com/jasontaylordev/CleanArchitecture
You can follow also this tuto :
https://jasonwatmore.com/post/2021/07/18/net-5-role-based-authorization-tutorial-with-example-api