"登录失败"在asp.net mvc的4使用LinkedIn的OAuth [英] "Login Failure" using LinkedIn OAuth in asp.net mvc 4

查看:179
本文介绍了"登录失败"在asp.net mvc的4使用LinkedIn的OAuth的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在看一下附带asp.net mvc的默认的OAuth实现4.绝对是IM pressive,因为所有我要做的就是在AuthConfig.cs加入这一行:

I am taking a look at the default OAuth implementation that comes with asp.net mvc 4. It definitely is impressive, as all i had to do was add this line in AuthConfig.cs:

OAuthWebSecurity.RegisterLinkedInClient("_key_", "_secret_");

启用上述,也提供了LinkedIn链接登录。系统提示我输入密码一次,但进入后我得到:

enabling above, did offer up the LinkedIn link to login. I was prompted for password once, but after entering it i got:

登录失败。失败登录的服务。

"Login Failure. Unsuccessful login with service."

,并已收到此自从瓦特/出不断被提示输入密码一次。

, and have been getting this ever since w/out ever being prompted for password again.

这是我不太清楚,如果这是由于初始坏凭据我进入,或者一些与我设置的键的方式。

It is not clear to me if this is due to initial bad credentials i entered, or something with the way i set up the key.

另外,我没有看到实际控制code之内我的应用程序的任何地方,所以即使我的工作登陆,目前尚不清楚如何我能获得来自联..​​即历史信息。

Also, i don't see the actual controller code anywhere within my app, so even if my login worked, it is not clear how i could obtain information from linked in.. i.e. history.

这是不错这种集成多么容易,但我倾向于一个更多的手动实现这一点?

it is nice how easy this integration was, but I am leaning towards a more manual implementation of this?

不过,我不禁在想,上面的实施很可能也适用。

however i can't help but wonder that above implementation probably also works.

更新

我已经跟踪这个问题是这样的电话:

i've traced the problem to be this call:

public ActionResult ExternalLogin(string provider, string returnUrl) {
    return new ExternalLoginResult(provider, Url.Action("ExternalLoginCallback", new { ReturnUrl = returnUrl }));
}

回调回来了 401未授权 ..即使凭据是正确的。从我可以在其他职位收集,这可能是由于通过OAuth的库不正确地形成头?

callback comes back with "401 Unauthorized".. even though the credentials are correct. from what i can gather in other posts, this may be due to incorrectly formed headers by OAuth library?

推荐答案

我有同样的问题,它会出现,这是一个错误。

I had the same problem and it would appear that this is a bug.

请参阅这篇文章上的保罗亚评论:

See "Paul Roa" comments on this post:

<一个href=\"http://blogs.msdn.com/b/webdev/archive/2012/08/15/oauth-openid-support-for-webforms-mvc-and-webpages.aspx?PageIndex=2\">http://blogs.msdn.com/b/webdev/archive/2012/08/15/oauth-openid-support-for-webforms-mvc-and-webpages.aspx?PageIndex=2

,然后他的解决方案(这对我的作品),在这里:

and then his solution (which works for me), here:

<一个href=\"http://blog.mrroa.com/post/30454808112/asp-net-custom-linkedin-oauth-provider\">http://blog.mrroa.com/post/30454808112/asp-net-custom-linkedin-oauth-provider

这篇关于&QUOT;登录失败&QUOT;在asp.net mvc的4使用LinkedIn的OAuth的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆