If you want to access the user email, you can make the following request. $userData = json_decode($userDataJson,true) $url = '(id,localizedLastName,localizedFirstName,profilePicture(displayImage~:playableStreams))' Ĭurl_setopt($crl, CURLOPT_FRESH_CONNECT, true) Ĭurl_setopt($crl, CURLOPT_RETURNTRANSFER, true) Ĭurl_setopt($crl, CURLOPT_HTTPHEADER, array("Authorization: Bearer ".$accessToken)) GET request for user data (does not contain email) using accessToken in Authorization header Here, we are accessing user data like profile picture, first name and last name. Now you have the access token, you can make requests to access user information. close the connection, release resources used Now, using Javascript we will give onclick action to the button.Copy these as it will need in next step.įor this example, I have created a button through html code LinkedIn Under the same section, you will find Client ID and Client Secret.On this URL, the linkedin will redirect to this URL on successful authentication of the user. Under the Auth section->OAuth 2.0 settings, enter Authorized redirect URLs for your app. To continue further, click on Continue to LinkedIn Developers. If your app is verfied successfully then you will get a message that you are verified successfully. Click on Generate URL to verify your app.Ĭopy the URL and open in the new tab. By clicking on verify button as belowĪfter clicking on button, a popup will appear. You will see the Create an App screen where you have put all the details.Īfter that you have to verify your App. After signin successfully, click on Create app button.Go to linkedIn developers page, create your account.Step 1: Get Client ID & Client Secret key The OAuth integration in the example is made using PHP and Javascript is used on browser side. This article assumes that you already have a LinkedIn account.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |