IronBookStoreAuth
Research & testing different Authentication/Authorization techniques with ASP.NET Core - API
Business - Iron Book Store
We create a simple system to test different authentication/authorization techniques. We want a system to retrieve books & users. Furthermore, a user should be able to register in the system and the auth will be via Tokens. A user could have many roles.
Books
- /api/books - GET - Authorize Roles: GeneralManager or Administrator
- /api/books/{bookId} - GET - Authorize Roles: GeneralManager or Administrator
- /api/books - POST - Authorize Roles: GeneralManager or Administrator
- /api/books/{bookId} - PUT - Authorize Roles: GeneralManager or Administrator
- /api/books/{bookId} - DELETE - Authorize Roles: Administrator. In addition, an administrator must have created the book to delete it (implement policy to check it).
Auth
- api/auth/login - POST - Anonymous - Return JWT
- api/auth/register - POST - Anonymous - register new user with Roles: GeneralManager & Administrator
Users
- api/users - GET - Authorize Roles: Administrator or SecurityManager - Return all users
Project: IronBookStoreAuthJWT - JSON WEB TOKENS - Net Core 3.0
- Api Project - ASP.NET CORE 3.0
- Using JWT for Authentication & Authorization | Without Identity
- Implementing Role-based | Policy-based (simple&complex requirements) Authorization
- Entity framework core
- Repository pattern