搞定了,API中引用System.Web.Http.Owin.dll
在实现的OAuthAuthorizationServerProvider里面重写的
GrantResourceOwnerCredentials和GrantClientCredentials方法实现里面都创建AuthenticationProperties
var props = new AuthenticationProperties(new Dictionary<string, string> { { "as:client_id", context.ClientId } });
具体可以参考dudu的文章,而在API里取得AuthenticationProperties是以下方法
var authContext = await Request.GetOwinContext().Authentication.AuthenticateAsync("Bearer"); //authContext.Properties.Dictionary 里就是验证身份时传入的字典