我使用Owin中间件建立了OAuth验证,该验证基于使用“个人帐户”验证启动新Web项目时创建的默认项目。Asp.Net MVC 5 Owin Twitter验证投掷401例外
我已经调整了它一下,但Facebook和谷歌都在工作的伟大,但是,当我在“推特”按钮,单击发出挑战,它抛出一个500 HTTP异常与错误消息:
响应状态码不表示成功:401(未授权)。
这只有推出了Twitter。这是我的身份验证的配置:
// Just a configuration section that reads from the web.config
var configuration = new OwinCookieConfigurationSection("owinCookieConfiguration");
app.UseCookieAuthentication(GetCookieAuthenticationOptions(configuration));
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
app.UseTwitterAuthentication(
consumerKey: "XXX",
consumerSecret: "XXX"
);
app.UseFacebookAuthentication(
appId: "XXX",
appSecret: "XXX"
);
app.UseGoogleAuthentication();
这绝对是一个500错误,而不是一个401错误,因为它表明,我已经证实,它从未使它通过了最初的攻击后到Twitter。堆栈跟踪似乎显示Twitter的不是从ObtainRequestToken调用返回成功代码:
任何想法?
哇。辉煌 - 谢谢! – MikeAtCodeSmart
可选字段不可选。哈哈! – JoshYates1980
仅供参考在设置网址后大约需要5分钟才能生效。我在这一天浪费了一天的时间。 –