I want to build a Web API with following features:
- Support OAuthv2 authentication
- Can be accessed by multiple clients
- Can restrict which client has access to which API method (like some XML file storing Client to API mapping)
The working scenario is like:
- A user logs in to a web application after authenticating by Azure AD.
- The Azure AD provides a token containing the UserDetails and ClientId.
- Call the API by passing the token (received in Step 2 above) in Header as Authentication: Bearer {{Token}}
- API should get the token, validate if this is from a valid client and if client has access to this API
It would be great if someone can point to a sample source code for reference/help.