• Home
  • Categories
  • Recent
  • Popular
  • Pricing
  • Contact us
  • Docs
  • Login
FusionAuth
  • Home
  • Categories
  • Recent
  • Popular
  • Pricing
  • Contact us
  • Docs
  • Login

Facebook images missing

Scheduled Pinned Locked Moved
Q&A
facebook images webhooks
0
2
1.3k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    dan
    last edited by dan 13 Jan 2021, 17:34

    Hello Community.

    I noticed that imageUrl of users logged in via the Facebook IDP expire when a user doesn't login regularly. Is there any possibility to cache those images within fusionauth or do I need to take care of it myself? The images clearly expire on Facebooks side (only IDP I've tested so far). Image requests (which previously worked) respond with a 404.

    Before implementing my own strategy I want to make sure there isn't a better way.My solution would look as follows:

    • Register a webhook which listens to the user.login event, read users imageUrl Property.
    • On my Backend, I'd fetch the image and create a copy of it on my backend, storing it in an s3 bucket or someplace else.
    • Then update the user in fa with a url pointing to the copy in a property under data (like data.avatarUrl).
    • On the frontend I'd always use the url pointing to the copy.

    This would update users image on every login via IDP while allowing the use of data.avatarUrl for manually uploaded avatars as well.

    Is there a better way?

    --
    FusionAuth - Auth for devs, built by devs.
    https://fusionauth.io

    1 Reply Last reply Reply Quote 0
    • D
      dan
      last edited by 13 Jan 2021, 17:38

      So, this appears to be a limitation of Facebook. Here are the API docs from Facebook which have no mention of how long the image URL returned if you pass redirect=0 is good for.

      Looks like some Auth0 users also encountered this.

      So I think you are on the right path with downloading the user's Facebook images and updating them on your side every time a user logs in.

      --
      FusionAuth - Auth for devs, built by devs.
      https://fusionauth.io

      1 Reply Last reply Reply Quote 0
      1 out of 2
      • First post
        1/2
        Last post