【发布时间】:2014-03-06 05:59:44
【问题描述】:
我已经使用 Owin 中间件设置了 OAuth 身份验证,该身份验证基于在使用“个人帐户”身份验证启动新 Web 项目时创建的默认项目。
我对其进行了一些调整,但 Facebook 和 Google 运行良好,但是,当我点击“twitter”按钮发出挑战时,它会抛出 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 调用返回成功代码:
有什么想法吗?
【问题讨论】:
标签: twitter oauth twitter-oauth