"Login Error" using LinkedIn OAuth in asp.net mvc 4

I am considering the default default OAuth implementation that ships with asp.net mvc 4. This is definitely impressive since all I had to do was add this line to AuthConfig.cs:

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

By incorporating the above, they offered a LinkedIn link to enter. I was asked to enter the password once, but after entering I received:

"Error logging in. Unsuccessful login with the service."

and since then it has passed since w / out again the password is requested.

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

In addition, I do not see the actual controller code anywhere in my application, therefore, even if my login worked, it is not clear how I can get information from the linked in .. that is, the history.

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

However, I cannot help but wonder what is probably also working on the implementation.

UPDATE

I traced this problem as a call:

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

the callback returns with "401 Unauthorized" .. even if the credentials are correct. what can I gather in other posts from, can this be due to malformed OAuth library headers?

+4
source share
4 answers

I had the same problem and it turned out to be a mistake.

See "Paul Roa" comments on this post:

http://blogs.msdn.com/b/webdev/archive/2012/08/15/oauth-openid-support-for-webforms-mvc-and-webpages.aspx?PageIndex=2

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

http://blog.mrroa.com/post/30454808112/asp-net-custom-linkedin-oauth-provider

+7
source

I had the same problem.

I updated all OAuth packages with NuGet and now everything is working fine.

+2
source

It looks like OAuth was sent to vs2012 with an error. Here is a lesson that explains why the error. http://www.devcurry.com/2013/01/connect-to-linkedin-using-oauth-in.html

I also needed to update Nuget in order to update the DotNetOpenAuth.Core package. After the update, it worked as expected. Hope someone finds this helpful.

+2
source

Sounds like bad credentials, it worked for me. Unfortunately, the template does not allow you to change passwords or delete accounts, but you can delete the LinkedIn connection and then create a new account from your LinkedIn login to try again.

As for the implementation that they use and extend, I have not figured it out yet. Plan on doing this, although I also think about using it if it looks good.

+1
source

Source: https://habr.com/ru/post/1438281/


All Articles