Getting publicly accessible user thumbnail URL for GSuite public user photos - thumbnails

User's photo URLs are available through the Directory API (I'm using the Java client, which shouldn't matter), however the URL provided is in the private scope, even when that user's profile image is set to public. This causes redirection to a generic silhouette image. I'm aware you can get the base64 encoded 96x96 pixel image via the user/photos API, however needing to serve GSuite's profile images myself is ridiculous. What is the correct flow to get user's image URLs for display?

Related

Keeping Facebook user profile picture current

When a user signup with facebook in an app, the user profile information can be stored on the client side. What should be the strategy to refresh this?
with example flow like below.
User sign-up with facebook from client
Facebook returns user profile ( on successful user accept), token
client stores the user profile including profile picture url
client uses the url to show user image in client
user changes profile facebook profile image and deletes old image -> client doesn't get to know about
Given that the token may be still valid, what should be the strategy for the client to make sure the user profile picture url is current ?
To keep the user photo current, link to https://graph.facebook.com/{userid}/picture wherever you would be linking to the image url in the client.
[The /picture edge returns an image by default](https://developers.facebook.com/docs/graph-api/reference/user/picture/]
If you want to know specifically when the user has a new profile photo, periodically check the url of the most recent photo you have against the url field returned by https://graph.facebook.com/{userid}/picture with redirect=false. If the urls differ, the user has changed their photo.

Is it possible to use a self expiring photo through a link to a 3rd party server as a social media profile picture?

Suppose I have developed an app that creates encrypted images with a self expiring link that can only be opened through browser, and I want to use such service to have temporary profile picture say on facebook.
When I use Devise and OAuth in a web app, every time user signs in, e.g. with facebook credentials, it retrieves an image through a link from facebook server (of course you can optionally save the image on the app's server). I wonder if a reverse mechanism can be used to ask facebook to use a certain link for profile photo, and if nothing is available just uses a default profile photo.

Uploading photos to Facebook API on localhost

I'm trying to test out uploading photos to an album using Facebook API. I am currently testing using Localhost and am trying to figure out how I can provide an appropriate url for the post to the Facebook servers. I have uploaded an image to a tmp folder in my application and have a path for that but is there anyway I can, from this path, create a url that would be appropriate for the image parameter in the query string post to Facebook when I'm using Localhost?
You cannot send a localhost url as an image parameter to Facebook.
If you want to test your code, upload your application to an actual server somewhere which can be accessed over Internet. and then generate a URL and send to to Facebook.
Hope that helps

Create website with facebook login for 0fees.net

Today I was trying to add Facebook features to my site. It's hosted on 0fees.net.
On 0fees.net, I uploaded index.html to my web host, for example mysite.0fees.net. This works, and the page opens fine when I access the URL.
Then, on Facebook, I created my Facebook application, and set the 'Website with Facebook Login' setting as http://mysite.0fees.net/, pressed Save Changes. But I got the error message,
Error Site URL is not a valid URL.
When I try set another URL (for example mysite.1fees.net) the application saved fine.
I do not want to change provider, so how can I set mysite.0fees.net?
When trying to post the link http://0fees.net/ on Facebook, you’ll see a message that you can not do so because the domain is blocked for being spammy. So you’ll have to use another domain, I’m afraid. (That’s the problem with cheap webhosting where you’ll only get a subdomain – let one user do something stupid under that main domain, and all other’s using it will get punished as well.)

Uploading Photos to Facebook using Graph API

I would like to provide users of my application with ability to upload photos to their Facebook account. The application has a username and password form for the users to fill.
In Graph API, there's a method for uploading photos. But I'm unsure how to authenticate - it doesn't seem to provide a way to supply username and password. It requires access_token.
What's the right way to allow users authenticating and uploading photos using username and password?
It's hard to tell how you want to do this without a sample code or even stating what technology you are using..
Anyway, almost ALL interactions with facebook graph api require an access token and most likely an extended permission.
First of all, for you to post/upload a photo you need:
The publish_stream extended permission
A better understanding of how and where the photo will be uploaded to, this can be done by reading the publishing section in the photo documentation
Now that you have a general idea, in your destination/submission page of your form and when the image is successfully uploaded to your server and it's location is known (obviously), use one of the two answers in this question to upload the image.
P.S: I don't really understand why you need a username & password in first place, but it's your application...
To clarify, the access_token is what you receive after the user authorize your application. So , the provision of username and password only need to be done once, when user first access your app.
You need to redirect user browser or client to : https://www.facebook.com/dialog/oauth... (Refer to https://developers.facebook.com/docs/authentication/ )
Then after you have the access_token, you can just use that for the api call to upload photo to that user.
The authorization process need to be done again when the token is expired.