Skip to main content

How To Login With linkedin Using Javascript


 Login With linkdin Using Javascript

Hello friends ajj me apko btaunga ki kis parkar ham javascript ka use karke login kar sakte hai.

Step 1- https://www.linkedin.com/developer/apps

Sabse pehle aap  upper diye gye link se linkdin app create kar lijiye yanha apko kuch detail company name,app name etc fill karne hai

Step2-yanha website url me aap apne file ke path dale jese me is program ko localhost par run karwa raha hu uska website url is parkar hai

Example-http://localhost/linkdin/index.php/ or http://localhost/linkdin/

Aap in dono me se kisi be trah se apna website address enter karke apna linkdin app create kar sakte ho

Step3- app create hone ke bad apko yanha se ek api key milege jise hme niche diye gye code me sirf paste karke code ko save kar dena hai

Steps4- create a file index.html



Index.html



<html>

<head>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>



<script type="text/javascript" src="//platform.linkedin.com/in.js">

    api_key:
enter your api key here

    authorize: true

    onLoad: onLinkedInLoad



</script>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>



<script type="text/javascript">

    

    // Setup an event listener to make an API call once auth is complete

    function onLinkedInLoad() {

        IN.Event.on(IN, "auth", getProfileData);

    }



    function getProfileData() {

        IN.API.Profile("me").fields("id", "first-name", "last-name", "public-profile-url", "email-address").result(displayProfileData).error(onError);

    }

    // Handle the successful return from the API call

    function displayProfileData(post){

        var user = post.values[0];

        document.getElementById("first-name").innerHTML = user.firstName;

        document.getElementById("last-name").innerHTML = user.lastName;

        document.getElementById("email-address").innerHTML = user.emailAddress;

        document.getElementById("public-profile-url").innerHTML = '<a href="'+user.publicProfileUrl+'" target="_blank">Visit profile</a>';

        document.getElementById('profileData').style.display = 'block';

        

    }





    // Handle an error response from the API call

    function onError(error) {

        console.log(error);

    }





// Destroy the session of linkedin

    function logout(){

        IN.User.logout(removeProfileData);

    }

    // Use the API call wrapper to request the member's basic profile data

    // Remove profile data from page

    function removeProfileData(){

        document.getElementById('profileData').remove();

    }





</script>







</head>

<body>















<script type="in/Login"></script>

<center>



<div id="profileData" style="display: none;">

        <p><a href="javascript:void(0);" onClick="logout()">Logout</a></p>



      <h1> firstname   </h1>  <p id="first-name"></p>

         <h1>last name   </h1>  <p id="last-name"></p>    

       <h1> email id   </h1> <p id="email-address"></p>

       <h1>   link </h1> <p id="public-profile-url"></p>

        </div>

    </div>

</div>

</center>

</body>





</html>



Yanha apko sirf apke dwara bnaye gye linkdin aap se  milii api key enter karne hai

    api_key:
81yra1eep4uvyw

head section me api key me apko apke dwara bnaye gye app se apko jo api key mli hai use yanha enter karna hai.or code ko save karna hai.

Is parkar aap easily 2 minutes me login with linkdin (javascript) ka option apne website me add kar sakte ho.

Thank You

Team Gajabwap Web In Hindi


Comments

  1. bro but ache Post hai apki ye post but helpful rheere Lite I am fresher keep it up good work your blog is best

    ReplyDelete

Post a Comment

Popular posts from this blog

How to Download Vimeo Thumbnail With PHP

Vimeo Thumbnail Downloader Tool – Vimeo Video Ka Thumbnail Download Karein Aaj ke is tutorial mein hum Vimeo Thumbnail Downloader Tool ke baare mein jaanenge. Is tool ki help se hum Vimeo video URL se us video ki thumbnail image obtain kar sakte hain. Agar aap PHP, Web Development, HTML, CSS aur Online Tools banana seekh rahe hain, to ye ek useful PHP project example hai. Vimeo Thumbnail Downloader Kya Hai? Vimeo Thumbnail Downloader ek simple tool hai jisme user Vimeo video ka URL enter karta hai. Tool Vimeo video ID ko identify karta hai aur available thumbnail image ko display karta hai. Example Vimeo URL: https://vimeo.com/389063954 Is URL mein: 389063954 Vimeo video ID hai. Vimeo Thumbnail Downloader Kaise Work Karta Hai? Is PHP script mein mainly do functions use kiye gaye hain: 1. getVimeoId() Ye function Vimeo URL se video ID find karta hai. 2. getVimeoThumb() Ye function Vimeo video ID ke basis par thumbnail information retrieve karta hai aur available thumbnail...

How To Create Contact Form With Validation-Php & Html

How To Create Contact Form - Hello Friends Ajj Me Apko Btaunga   Ki Kis Prakar   Ham Apni Website Ke Liye Contact Form Bnana Sakta Hai.( By Using   Php Contact Form With Validation Script ) Contact Form Hmare Website Ke Liye Bhut He Jrruri Hota Hai.Contact Form Ke Help Se He User Apna Message Website Owner(Admin) Ko Bhej Sakte Hai. Ajj Me Apko Btane Wala Hu Ki Kis Parkar Ham Contact Form Banakar Apne Website Me Add Kar Sakte Hai Or Apni Website Ke Liye Contact Form Bana Sakte Hai Is Contact Form Me   Ham Php Mail Function() Ka Use Karege . Ab Jab Be Koi User Contact Form Me Apni Information ,Message Details Fill Karke Submit Karega To Uski Sare Information Website Admin Ke Email Id Par A Jaiyegi Jo Be Admin Dwara   Niche Diye Gye Code Me Setup Ki Hogi. Used Language- ·          HTML ·          Jquery ·          Php ...

How To Send Sms From Website Using Php-Textlocal SMS

Hello Friends Ajj Me Apko Btaunga Ki Kis Prakar Aap Apni Website Me Free Sms Send Ka Option Integrate Kar Sakte Ho. Bulk sms in India-Best company Iske Liye Apko Sabse Pehle   Https://Www.Textlocal.In/Signup Par Signup Karke Account Create Karna Hai.Ye Ek Achi bulk sms provider company hai ·          Account Create Hone Ke Bad Aap Apna Username And Password Enter Karke Apne Dashboard Me Login Ho Jaiye( textlocal login) ·          Yanha Apko Text Local Company Dwara 10 Meassge Free Testing Ke Liye Diye Jayege ·          Aap Sms Plan Buy Kar Sakte Ho Is Company Dwara Bhut He Kam Prize Me Sms Pakage,plan provide  Kiye Jate Hai Textlocal Price Plans –  index.php <?php if(isset($_POST['code']) &&  isset($_POST['mobile'])){ // Authorisation details. $username = "enter your textlocal account email id here"; $hash = "...