我已经使用Owin中间件设置了OAuth身份验证,它基于在使用“个人帐户”身份验证启动新的Web项目时创建的默认项目。
我调整了一点,但Facebook和谷歌工作很好,但是,当我点击“twitter”按钮发出挑战,它抛出一个500 http异常与错误消息:
Response status code does not indicate success: 401 (Unauthorized).
这只是推出了Twitter。这里是我的auth配置:
// 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调用返回成功代码:
有任何想法吗?