I have implemented Oauth with my WebAPI 2 application and there are several applications access the API. Once authenticated, after making a request whilst sending across the auth token, I can access the user as follows:
var currentUser = RequestContext.Principal;
When logging in, the clientId was set as follows:
context.OwinContext.Set<AppClient>("oauth:client", client);
Is there a way to access that client Id? I want to restrict certain actions / controllers to certain clients. Is there a way to do this?
I have tried getting the client as follows:
var client = Request.GetOwinContext().Get<string>("oauth:client");
but this is not working.