Question

I have created a username and password to enter and search people in linkedin. Now, I am devloping a web application using asp.net. I need to open a popup page which is displaying the searched results in linked in as logged in. When the popup page is displaying, I need to logged in automatically using the username and password.

So, here is my question, How to logged in automatically when the button clicked in Asp.net application using linked in username and password?.

Thanks

Was it helpful?

Solution

The problem is twofold:

  1. deciding which credentials to use
  2. actually logging in

Logging in is fairly straightforward: post to LinkedIn's login URL in the manner that LinkedIn expects. Unfortunately, LinkedIn still does not have a public API, so this is going to require hackery. Go to a LinkedIn web page that allows login and analyze the page source. There will be a field names for username and password in the login form, and the login form will post to a specific URL. Duplicate the username and password with a web request to the URL of the form. You will receive a cookie as part of the response. Make sure you include that cookie in future requests to LinkedIn and you are then "logged in" for every request.

Of far more importance than the actual logging in, which is a simple programming challenge, is deciding which credentials to use. I'm guessing that you're building an application for others to use, rather than yourself. If so, you'll need to ask them to give you their LinkedIn credentials. Beware: this is something that most people simply will not do. It's a trust issue; if they give you their credentials, you now have access to their profile and can do nefarious things with it. You'll need a good disclaimer explaining how you would never do that, ever, and you'll need the people who read it to believe you. Not as easy as it sounds.

If, however, this is just for you, you're on easy street. Just use your own credentials.

OTHER TIPS

Maybe this article helps: http://www.suddenelfilio.net/2010/08/24/linkedin-oauth-using-hammock-in-csharp-asp-net/ is shows how to use the linkedin api using the Hammock Rest library on codeplex+

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top