aspnetcorehero / Boilerplate

Clean Architecture Solution Template for ASP.NET Core 5.0. Built with Onion/Hexagonal Architecture and incorporates the most essential Packages your projects will ever need. Includes both WebApi and Web(MVC) Projects.
https://codewithmukesh.com/project/aspnet-core-hero-boilerplate/
MIT License
582 stars 148 forks source link

API Response http 401 "You are not Authorized" for all the roles with all permissions. #38

Closed AhmedRamadanDev closed 2 years ago

AhmedRamadanDev commented 2 years ago

Describe the bug Users Can't access the API.

To Reproduce Steps to reproduce the behavior:

  1. Use Swagger UI to Generate a user token that have superadmin role with all permissions.
  2. Authorize the user
  3. Use one of the GET API endpoints (ex. Brand)

Expected behavior Return an empty Array of brands.

Desktop (please complete the following information):

Additional context The UsersToken Database is empty!.

AhmedRamadanDev commented 2 years ago

The problem was that the Authorize button in the Swagger UI didn't put "Bearer " Before the token!