简体   繁体   中英

Getting facebook profile while signup with facebook in liferay

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?

您将用户个人资料图片的网址设置为-

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 !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM