Display profile data LinkedIn Api without authentication - javascript

Quick questions, but can I display profile data from my own LinkedIn page on a website through the JavaScript SDK, without having the user login through the authentication layer ?
I don't want to display any other information other than from my profile, I was under the impression this is possible without a user logging in.
https://developer.linkedin.com/docs/js-sdk
I have connected correctly:
<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key: xxxXXXxxxXXXxxx
onLoad: linkedInLoaded
</script>
but then using the follow:
IN.API.Profile("me").fields([]);
Tells me I require authentication.

Hi #CHEWX I misunderstood your original question. Yes, you are correct, what you are trying to do is not possible. What are you looking for is the ability to make an unauthenticated call to pull any random profile (and for your use-case, you would always be pulling your own profile). However, LinkedIn does not have any unauthenticated APIs available.
The only thing that comes close to what you are looking for is a drop-in plugin which you can find here: https://developer.linkedin.com/plugins/member-profile
You could build some service that makes an authenticated REST call to pull your profile every so often, and then push the updated profile info to wherever you are saving it to display it on your website.

Related

Using access token without facebook log in (Graph API)

I'm working with javascript and i've made a site for only one person (admin), who needs to log in to Facebook and then the script extracts data from many public pages on facebook through some ids i've saved in a local database.
What i'd like to do now is actually the same, but without user interaction. This means the admin shouldn't log in his facebook account to start viewing facebook pages stats.
Is there anyway to code making use of a token (I've read that you can make them permanent) and instead of logging in to facebook in your welcome page, just start watching pages stats? Is there anyway to just skip the log in pop up from Facebook?

Get link to Facebook profile with passport.js

I am using passport.js to let users log in.
I am wondering if it's possible to create a link to their profile on their social media account?
For instance, when logging in using Facebook, I can get an ID, but the link https://www.facebook.com/profile.php?id=__ID__ doesn't work.
Maybe it's not possible at all since some Facebook users might have their Facebook profile hidden even though they use their account as login for other websites.
From what i know, this is not possible using passport at least.
The reason why the link doesn't work is that the ID returned by Facebook is always app specific so different apps would get different IDs for the same user. So you don't get the "official" ID of a user which you could use for building the URL.
However, the Facebook API returns a link to a users timeline which should be the one you are looking for (https://developers.facebook.com/docs/graph-api/reference/user/). But from what i see in the documentation of passport, this information is not returned. So if you want to get the link you need to work with the Facebook API directly.

LinkedIn API Login With Specific Account

I would like to login using my own account in conjunction with the LinkedInApi. The problem I have is that most examples I can see either use a cookie or login interface for local users login credentials. However my aim is to login with my own specific account by providing my username and password.
I can then extract the testimonials from my profile and display them on my website.
Is this possible? And if so do you have any examples of how this can be achieved?
After thinking about this for a considerable amount of time I realised that the answer is quite simple.
If you make the API call on the server side you can specify the credentials. For example in an MVC application you might make the call on the controller action method.
If you want to allow users to login using LinkedIn you should first create an app in LinkedIn from the below link
https://www.linkedin.com/developer/apps.
Then Add LinkedIn login button from this Url
https://developer.linkedin.com/docs/signin-with-linkedin
Below is the link you will find the complete solution.
http://www.c-sharpcorner.com/UploadFile/145c93/sign-up-users-using-linkedin-and-save-users-detail/
I am not promoting the article, just providing the link where you will get the complete solution.

When should I use javascript or PHP facebook SDKs for login activities

I'm building a PHP web application, something like "Auction", I want to let the user to sign in using their facebook accounts.
I started using javascript SDK, I've built the first page in which I asked the user to login using facebook, after the authentication is made, the page refreshes and according to some cookies I stored after the authentication, the page layout and elements change.
I want to save the login status in such a way the server knows if the user is authenticated or not, I know I can same the appropriate cookies to give the server these information, so do I need the PHP SDK in the future? Is it better if the retrieving of user info done in PHP at server side? what advantages I get from using the PHP SDK rather than using the javascript?
I'm sill in the very beginning of the development process, and I'm not sure if I'm going the right way to use the javascript SDK alone! any help concerning this dilemma will be appreciated.
thanks

Grabbing facebook feed in website

I develop mobile websites for my clients. This particular client would like some facebook wall activity to be displayed on the website. I have looked into the facebook graph api and am getting confused on authentication.
I need the blah in https://graphs.facebook.com/clientsfacebookid/feed?access_token=blah
in order to grab the info i want. I read about authentication and all of that but it doesn't seem to serve my purposes.. For example a lot of the stuff I read about getting a token is related to creating apps and stuff - which is not what I'm trying to do. A lot of ways to authenticate redirect users to log in or grant access to the information but this also doesn't seem like it fits my scenario.
Should I just talk to my client and get them to send me an access code or set up some stream so I can grab an updated access code anytime I need it OR is there some built in functionality in the API that I could benefit from using.
Any thoughts?
P.S. I am trying to implement this via an ajax call in javascript.
Thanks!
What you'll need to do is create a Facebook App and have your client add this to their page. You can then get an OAuth token for this app and use it to query the client's feed. See the Facebook documentation for authenticating as an app for details.
It's actually far simpler if you just want to grab the data from the page. Create an App, but you don't need to add it to the actual page. You can generate an App Access Token by following the instruction on the Facebook Developer Website.
Then, all you need to do is call the Graph API with the generated access_token. E.g.:
https://graph.facebook.com/{page_id}/feed?access_token={app_access_token}
You can then use the data returned by Facebook to display selected posts from the page.
The Page Admin doesn't need to add the app to the page, and this method can be used to scrape any published page. The posts on Pages is public anyway, you just need an access_token to access the page.
If you want a simple way to learn and have an example of a working model try out fourgefeed.com its a simple framework with a simple to implement example kinda like jquery.

Categories