C# ASP标识和Owin-令牌生成
我有以下资料:C# ASP标识和Owin-令牌生成,c#,.net,asp.net-web-api,asp.net-identity,owin,C#,.net,Asp.net Web Api,Asp.net Identity,Owin,我有以下资料: OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions() { AllowInsecureHttp = true, TokenEndpointPath = new PathString("/token"), AccessTokenExpireTimeSpan = TimeSpan.FromDays(1), Provider =
OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions()
{
AllowInsecureHttp = true,
TokenEndpointPath = new PathString("/token"),
AccessTokenExpireTimeSpan = TimeSpan.FromDays(1),
Provider = new SimpleAuthorizationServerProvider(),
};
一切正常,我需要使用内容类型:application/x-www-form-urlencoded
我的问题是,我需要允许从不能以内容类型发送数据的客户机生成令牌:application/x-www-form-urlencoded
,她只能以Json形式发送参数,根据OAuth 2,这是不允许的,而且Microsoft Owin不允许这样做
如何手动生成用于此目的的令牌?我假设我应该创建一个webapi
方法来实现这一点,但是如何使用常规的Microsoft Owin提供程序呢
非常感谢您可以创建一个WebApi端点作为代理,这意味着您将以JSON的形式接收参数,并且您可以在内部调用
/Token
将参数转换为内容类型:application/x-www-form-urlencoded
看一看,这将简化您对令牌提供商的内部调用