Correct way to make authenticated calls for binary data in image tags

Since you’re using Vue.js, wouldn’t this work (not tested myself):

I’ve seen other approaches such as mentioned on

  1. From the browser, make a post request to backend, let them know you are an authorized client (include the authorization header), and ask for a temporary url that will show the image publicly
  2. From the backend, generate a signed url that is valid for a limited time and does not require authorization headers to show the image.

but if the Vue.js package above works, I think it would be the easiest.

2 Likes