PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, July 16, 2022

[FIXED] What is best practice for displaying avatar image in terms of users logging in with facebook

 July 16, 2022     facebook, facebook-graph-api, facebook-login     No comments   

Issue

We are using facebook login on our website and don't know if it is better to actually store the user avatar image on our servers and serve from there or just serve them using the graph API?

I understand the graph API will be more convenient since it will always bring the most up to date photo but I assume there will be restrictions?

Can someone please explain what is best practice when it comes to this?

Thank you.


Solution

Storing the user's image on your DB would add another level of complexity to your application.

What I would suggest is just use the Graph API. It would always return the most current Display Picture of the user and it wouldn't be restricted as it is public data.

The only thing you have to worry about is getting access to THAT public data by having the user Login Using Facebook on your website. You can only access the user's image if the user is logged in to your application.

Once you have that out of the way, you can now have access to the User Image with ease.



Answered By - Edrian
Answer Checked By - Cary Denson (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing