c# - How do I limit API access to known client applications in a Web API 2 application? -
i've created application comprised of 3 main components:
- a .net web api 2 project provides several webapicontrollers. methods, "register" open anonymous access, while others authorized using token-based basic authorization (the standard .net identity 2 approach included in .net webapi2 templates). in interest of quick-and-dirty functionality, layer communicates directly database using entity framework.
- an mvc5 project provides front-end web client , communicates web api.
- an ios client communicates web api.
with structure, end-users ("consumers") can create own accounts using unauthenticated "register" api method. users can access , manipulate own data via authenticated methods protected token-based authorization headers.
here's question:
how prevent unknown clients making calls api, without creating significant overhead or overhauling standard .net web api authorization functionality?
ideally, i'd able have sort of table of identifiers client applications can allow new client applications or disallow them necessary.
Comments
Post a Comment