Monday, May 13, 2013

LinkedIn login in our website using JavaScript in Asp.net

Introduction

In this article, I will explain how to associate LinkedIn login in our website using JavaScript in Asp.net.
First we need to create LinkedIn application and get api key from LinkedIn. so click on following link

https://www.linkedin.com/secure/developer

Use the following procedure.

Step 1

login in LinkedIn



Step 2

Click on "Add New Application"



Step 3

Following these steps



Step 4

Now api key generate by Linkedin and this api key write in javascript code


Step 5

Now write below code in our application


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LinkedIn_Login.aspx.cs" Inherits="LinkedIn_Login" %>
<!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Linkedin Login </title>
<script type="text/javascript" src="http://platform.linkedin.com/in.js">
api_key:************ // Write your api key
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="font-size:large; font-weight:bold; color:blue">
<script type="in/Login">
 
Hello,<br>
   <?js= firstName ?> <?js= lastName ?> <br>
Welcome to Linkedin
</script>
 </div>
</form>
</body>
</html>

Output 1


Click on SignIn button

Output 2



Click on Allow

Output 3