Reputation: 4112
I like a create a simple web blog (written in PHP), to satisfy my blog's audiences, he/she should only have to register to my blog once (using his/her Facebook user account), after then he/she wouldn't need to re-login to my blog again in the future
There are steps I can think of
new FacebookRedirectLoginHelper($facebook_redirect_url);
just as in SDK's documentation$helper->getSessionFromRedirect();
to access the Graph API to access user's public information, e.g. email, profile name, profile picture, etc.I think the above steps seem to meet my requirement, but if there is any suggestions please give me some ideas to improve
I wouldn't need the blog user to re-login ever again because I have all information I need in the blog's database, but the question is what to do to let my app get up-to-date information of the user (e.g. profile's picture, etc) I cannot use his/her access token to access the graph API anymore because it will always become expired
Please guide me some ideas for the solution
P.S. The most important requirement is to offer single registration & login to the blog's user, unless he/she manually logout
Thanks.
Upvotes: 0
Views: 340
Reputation: 2642
You can get the public information of any user if you have their facebook id or user name. For example you can get my public details using the below code:
https://graph.facebook.com/AbdulAzeez86
Here you can change username with id, which you will keep in your database. To get the profile picture of a user you can use the below code:
https://graph.facebook.com/AbdulAzeez86/picture?type=large
Here also you can change name with id and type with any of these (square,small,normal,large)
To get the contents you can use curl ,file_get_contents etc.
Upvotes: 1