'Error : Authorization has been denied for this request

I have created web api method to insert some data. It works fine anonymously. But when I decorate the method with [Authorize] , I recieve message like "Message": "Authorization has been denied for this request." jwt bearer token was entered with the request.I run the function using Postman. Should I add any class to validate the bearer token?

    [Authorize]
    [Route("customer")]
    public String customer(APICustomer APICustomer1)
    {
        try
        {
           
           insert_Customer(APICustomer1.custid, APICustomer1.custname, APICustomer1.status);
        }
        catch (Exception ex)
        {
            
        }
       
        return "1";
    }


Solution 1:[1]

Authentication is the process of validating user credentials and authorization is the process of checking privileges for a user to access specific modules in an application. Please read the article for more detailed information: Authentication And Authorization In ASP.NET Core Web API With JSON Web Tokens

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mehran Khan