
when adding [Authorize] at any Endpoint


Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Tahir AnsariPosted Aug 18, 2023, 3:24 AM
The "[Authorize]" attribute in ASP.NET Core API is used to specify that only authenticated users can access a particular endpoint. If you're encountering a "not found" error after adding the "[Authorize]" attribute, please ensure that you have the required authentication and authorization configuration set up correctly in your application. This might involve setting up authentication schemes, configuring roles, and adding authentication middleware to the pipeline. Double-check your configuration and make sure you've properly set up authentication before using the "[Authorize]" attribute. If you need specific help, please provide more details about your setup and the error message you're encountering.