简体   繁体   中英

Transparently Get Facebook Profile Pictures

I'm just getting into the Graph API and am having having a hard time trying to figure out if/how I can go about showing MY profile albums on My website with out having to have the user log into facebook. I'm getting thrown off with the access token...I realize I can retreive an access token to retreive my photos if I have someone log on to the site, but I want it to be transparent, using my credentials through code (securely) some how if necessary.

How can I accomplish this? I'm looking for a general conceptual explaination, but pseudo code never hurts. Can any one clear it up for me a little?

Using:
Facebook Javascript Sdk
Mirosoft MVC
Facebook C# Sdk

There's no way, that I'm aware of, to do that.

Facebook apps treat all users the same, you can't have special privileges for your user. If your user is public then you should be able to get all of the public using an application access token which does not expire.

If that's not the case then you have two options as I see it.

Use the server side authentication with your user, or extend a valid token (a method to replace the deprecation of the "offline_access" permission), that will get you a long lived token, about 60 days, and in that time frame you can then get your data from facebook. Then when that expires re-authenticate in the same way and get another 60 working days, etc.

Another approach is to authenticate as yourself and then have your app save the data, then present it from your own db. Be sure to update the data every once in a while.

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