Error 403 when downloading document changes

Integration questions/issues
Post Reply
oguerin
Posts: 7
Joined: Wed May 02, 2018 2:35 pm

Error 403 when downloading document changes

Post by oguerin » Mon Jul 02, 2018 2:49 pm

Hello,

We have connected the Document Server (Docker version) with our PHP application through a callback page in PHP. When we try to download document changes from the url given by the document server, we get a 403 error :

Code: Select all

        
        $downloadUri = $data_online["url"];
        $client = new Guzzle\Http\Client();
        $new_data = $client->get($downloadUri)->send()->getBody(true);

Code: Select all

2018-07-02T15:57:19+02:00 DEBUG (7): Client error response
[status code] 403
[reason phrase] Forbidden
If we take the downloadUri (something like https://our.server.com/cache/files/10_9 ... 4wLFakeA==) and paste it in a browser, it works. We get the office document with all changes. But if we try to get it with a curl or wget request, we get a 403 error.

Best regards,
Olivier

Maxim
Posts: 1781
Joined: Tue Oct 11, 2016 2:34 pm

Re: Error 403 when downloading document changes

Post by Maxim » Tue Jul 03, 2018 6:21 am

Hello!
Did you visit our API?

oguerin
Posts: 7
Joined: Wed May 02, 2018 2:35 pm

Re: Error 403 when downloading document changes

Post by oguerin » Tue Jul 03, 2018 8:22 am

Yes, we studied your API basic concepts, implemented the document storage service by following the Opening file section, Saving file section, learned that we have to deal with the Document history management. It works when we use http address, but not when we use https.

Maxim
Posts: 1781
Joined: Tue Oct 11, 2016 2:34 pm

Re: Error 403 when downloading document changes

Post by Maxim » Thu Jul 05, 2018 8:48 am

Hello!
Did you install SSL certs?

oguerin
Posts: 7
Joined: Wed May 02, 2018 2:35 pm

Re: Error 403 when downloading document changes

Post by oguerin » Thu Jul 05, 2018 9:46 am

Hello,

Yes, we genereated the certificates and followed instructions given here : https://helpcenter.onlyoffice.com/fr/se ... ation.aspx

Code: Select all

$sudo  docker run -i -t -d -p 8443:443 -v /u/apps/onlyoffice/data:/var/www/onlyoffice/Data -v /u/apps/onlyoffice/logs:/var/log/onlyoffice --net=bridge --name onlyoffice --restart=always onlyoffice/documentserver-de
8c906c1477277067cbae70e6e5bfc71877ee3f0e831c453dce627c6e7e9e346b
$ sudo docker logs -f onlyoffice
k * Starting PostgreSQL 9.5 database server                              [ OK ] 
 * Starting RabbitMQ Messaging Server rabbitmq-server                    [ OK ] 
Starting redis-server: redis-server.
Starting supervisor: supervisord.
 * Starting nginx nginx                                                  [ OK ] 
Generating AllFonts.js, please wait...Done
onlyoffice-documentserver:docservice: stopped
onlyoffice-documentserver:docservice: started
onlyoffice-documentserver:converter: stopped
onlyoffice-documentserver:converter: started
 * Reloading nginx configuration nginx        
In /u/apps/onlyoffice/data/certs, we have the following files :

Code: Select all

[centos@test05 ~]$ cd /u/apps/onlyoffice/data/certs
[centos@test05 certs]$ ll
total 12
-rwxr-xr-x 1 110 114  424 13 févr. 15:34 dhparam.pem
-rwxr-xr-x 1 110 114 2171 14 mai   15:46 onlyoffice.crt
-rwxr-xr-x 1 110 114 1704 14 mai   15:46 onlyoffice.key
(we have changed permissions on file onlyoffice.key to 400, but it goes back to 755 every time we launch the container)

oguerin
Posts: 7
Joined: Wed May 02, 2018 2:35 pm

Re: Error 403 when downloading document changes

Post by oguerin » Tue Jul 10, 2018 8:32 am

Hello, do you need more elements for our problem? Are there people having troubles integrating the Docker version of the Document Server in https?

Thanks for your advice.

Maxim
Posts: 1781
Joined: Tue Oct 11, 2016 2:34 pm

Re: Error 403 when downloading document changes

Post by Maxim » Tue Jul 10, 2018 11:16 am

Hello oguerin!
Are there people having troubles integrating the Docker version of the Document Server in https?
No.
https://our.server.com/web-apps/apps/ap ... nts/api.js - do you get API code?

oguerin
Posts: 7
Joined: Wed May 02, 2018 2:35 pm

Re: Error 403 when downloading document changes

Post by oguerin » Tue Jul 10, 2018 3:12 pm

Yes, we get API code :

Image

oguerin
Posts: 7
Joined: Wed May 02, 2018 2:35 pm

Re: Error 403 when downloading document changes

Post by oguerin » Fri Jul 13, 2018 12:52 pm

We have the same error in HTTP mode. We tested using file_get_contents instead of Guzzle and it works, in HTTP or in HTTPS mode.

Thank you for your assistance.

Post Reply