Hello,
I try to preview and download documents using the rest API. Everything works perfectly with token auth. I have a React app. Unfortunately, it's not possible to set the auth header with HTML img tag and regular link tags. I've tried to attach token with URL like <img src="http://api.com/image-link?&token=realtoken"> but it doesn't work. I couldn't find a way to solve this problem. How can I preview or download a doc outside of the Mayan EDMS admin panel using just the REST API?
Document preview and download using API links
Re: Document preview and download using API links
Just looking Ford the first result at stackoverflow.com, which looks promising
https://stackoverflow.com/questions/236 ... ms-to-pass
https://stackoverflow.com/questions/236 ... ms-to-pass
Re: Document preview and download using API links
It is not advisable to add the API token as part of the URL of images. The token will be visible upon network inspection even when using HTTPS. This is why API tokens and other authentication information is sent over the header which is encrypted or as part of the session like the answer @m42e posted.