I am trying to use the liferay inbuild facebook signin feature. By default facebook connect only stores first name,lastname,email and gender.
I want to get the profile picture of user from facebook and store in the database as userpotrait of a user when he sign up with facebook. How can do it in liferay?
You make the url for the profile picture of the user as -
http://graph.facebook.com/<USERID>/picture?type=normal
Try below URL to get facebook profile image.
http://graph.facebook.com/{your user name}/picture
You can easily get api for get this profile image for facebook also below link might help you.
Facebook API - How do I get a Facebook user's profile image through the Facebook API (without requiring the user to "Allow" the application)
For Store the image you will need to convert as a byte steam and store it using below Util class
UserServiceUtil.updatePortrait(long userId, byte[] bytes)
Hope this helps !
Related
I managed to implement Facebook login into my android app and it displays the public profile picture when I provide the access token in the link:
https://graph.facebook.com/{userId}/picture?type=large&access_token={ACCESS_TOKEN}
But what about the other users? It's a social media application and I want other users to see the profile picture as well.
Is this even possible after the changes Facebook made in September 2020?
I saw that Zynga Poker has exactly what I want, you sign up with Facebook and everyone else can see your profile picutre as well.
Can I somehow request from the user to give me the permission to use the profile picture piblicly?
I am using Facebook graph API v.2.11 and social login. My client wants to stores those users who is using facebook social login And for that we need those user public profile url. Under which field we can get this? are Need some addition settings to get it?
You need to ask the user for user_link permission to be able to do that and then use /me?fields=link endpoint to get the profile link. You can find more details here: https://developers.facebook.com/docs/facebook-login/permissions/#reference-user_link
Is it legal to create a web application where users can paste a facebook profile url and app will download and present a profile photo from that link ? An application won't be storing any data of that user.
No, you can´t do that because:
Scraping is not allowed, and that´s what you would need to do.
You can´t be sure if the user who posted the URL is the owner of the profile, he may just paste ANY URL. So the user who owns the profile may not have authorized you to use it.
The proper way to get the profile photo is to authorize the user in your App and use the /me/picture endpoint.
I'm using this tutorial http://pastebin.com/WpJmPYAi, and with some changes I can upload a photo to my fanpage.
But, I want to be able to upload when I'm logged out from Facebook. In my website, I need to be able to upload images to the fanpage without my account login.
Is this possible?
For example, I think: Is there any way to do this:
$page_info = $facebook->api("/".$fanpage."?fields=access_token");
Without a facebook accounts logged in, only with my app and accounts data.
You can set a stored access_token using the Facebook::setAccessToken($access_token) method.
See the PHP SDK documentation for details: https://developers.facebook.com/docs/reference/php/facebook-setAccessToken/
Is there any way to get the Facebook User Id of visitors in my website by using the FB API, but without need to ask them to authenticate my Facebook app?
All I need is some facebook-related-identifier, it does not even have to be the User Id, but any kind of identifier that can relate the user to a facebook profile.
Ideas?
If the user does not explicitly authorize you to get some private data from his Facebook account (included his Facebook ID), you can not get them.
I cannot think of a way to get the Facebook ID without the authorization of the user.
Hope that helps.