Reputation: 73
I already have a ready server on Asp.net WebApi. How can I add authorization to it? I looked through many articles, but everywhere a new project is created and the authorization method is selected there, but I did not find how to add to the existing one.
And I need to add like this but to an existing project.
Upvotes: 0
Views: 223
Reputation: 174
You may want to implement Authorize attribute and decorate each of your API with the same. The authorize attribute gets hit before proceeding to your API logic and you can have your custom logic to check if the caller has the Authorization to access the API.
Upvotes: 1