0

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.

during creation was selected enter image description here

And I need to add like this but to an existing project. enter image description here

1 Answer 1

1

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.

Authorize attribute example

Sign up to request clarification or add additional context in comments.

3 Comments

it looks like it's not that
Are you looking for Authorization or Authentication? You mentioned Authorization in the question description
I am looking for how to add to an existing Authentication project

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.