cloudinary-react icon indicating copy to clipboard operation
cloudinary-react copied to clipboard

Support for token based authentication?

Open bristoljon opened this issue 2 years ago • 3 comments

Hi, trying to work out how best to integrate token based authentication with this SDK.

Our backend provides a token giving access to specific folders in Cloudinary which we can append to the delivery url for assets to allow client to access restricted images however not sure how to provide this to the Cloudinary context...

Was hoping it would be something like:

<CloudinaryContext cloudName="demo" token={token}>
  <Image publicId="sample">
    <Transformation width="200" crop="scale" angle="10"/>
  </Image>
</CloudinaryContext>

And the SDK appends the token passed as a param.

bristoljon avatar Jan 04 '22 11:01 bristoljon

@bristoljon I have not found a good way to add this and it's definitely a missing feature to be able to add query strings. I will raise this with our team.

d-mendoza avatar Jan 06 '22 00:01 d-mendoza

Thanks @d-mendoza, we have actually switched to the new React SDK version and so are using @cloudinary/url-gen to configure the url generator now so we would not need it added to this package if it's made available there.

bristoljon avatar Jan 11 '22 17:01 bristoljon

We would most likely add it to V2, but once I have more details, I'll send an additional update.

d-mendoza avatar Jan 11 '22 18:01 d-mendoza