
When adding [Authorize] at any Endpoint

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
Tahir AnsariRank #366 · 6.8K reputationPosted Aug 17, 2023, 11:24 PM EDT
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.