{"id":5304,"date":"2018-07-09T16:38:01","date_gmt":"2018-07-09T12:38:01","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/how-to-restrict-access-to-the-onlyoffice-editors-to-the-users-of-your-nextcloud-instance\/"},"modified":"2018-07-09T16:38:01","modified_gmt":"2018-07-09T12:38:01","slug":"how-to-restrict-access-to-the-onlyoffice-editors-to-the-users-of-your-nextcloud-instance","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/how-to-restrict-access-to-the-onlyoffice-editors-to-the-users-of-your-nextcloud-instance\/","title":{"rendered":"How to restrict access to the ONLYOFFICE editors to the users of your Nextcloud instance"},"content":{"rendered":"<p><a href=\"http:\/\/nextcloud.com\/\" target=\"_blank\" rel=\"noopener\">Nextcloud<\/a>\u00a0integrated with\u00a0<a href=\"https:\/\/www.onlyoffice.com\/\" target=\"_blank\" rel=\"noopener\">ONLYOFFICE<\/a> allows users to build a private cloud office on their own server and get a total control over the data stored there. To deploy and integrate them, just follow the instructions of this <a href=\"https:\/\/www.howtoforge.com\/tutorial\/how-to-integrate-onlyoffice-with-nextcloud\/\" target=\"_blank\" rel=\"noopener\">tutorial<\/a>.<\/p>\n<p>Once you got your setup up and running, you may notice that ONLYOFFICE remains publicly accessible and can be used by any other instance out there. To restrict the access so that only users of one particular Nextcloud instance can access ONLYOFFICE editors, you can proceed in two different ways.<\/p>\n<h2 id=\"configure-ip-filter\">Configure IP Filter<\/h2>\n<p>Open the \/etc\/onlyoffice\/documentserver\/default.json file using any available text editor.\u00a0<\/p>\n<pre>\"ipfilter\": {<br\/>\"rules\": [<br\/>{<br\/>\"address\": \"ip_address\",<br\/>\"allowed\": true<br\/>},<br\/>{<br\/>\"address\": \"*\",<br\/>\"allowed\": false<br\/>}<br\/>],<br\/>\"useforrequest\": true,<br\/>\"errorcode\": 403<br\/>}<\/pre>\n<p>Change the following default settings. Enter your &#8220;ip_address&#8221; that can contain:<\/p>\n<ul>\n<li>IP in the X.X.X.X format for ipv4,<\/li>\n<li>IP in the xxxx.xxxx.xxxx.xxxx.xxxx.xxxx.xxxx.xxxx format for ipv6,<\/li>\n<li>dns-name,<\/li>\n<li>* wildcard to replace any symbol\/symbols.<\/li>\n<li>and the &#8220;allowed&#8221; rule that can be true or false.<\/li>\n<\/ul>\n<p>Restart the services for the config changes to take effect:<\/p>\n<p class=\"command\">supervisorctl restart all<\/p>\n<h2 id=\"enable-jwt-token\">Enable JWT token<\/h2>\n<p>Another possibility is to make access to the document server public and enable JWT token to secure the connection. <br \/>Open the \/etc\/onlyoffice\/documentserver\/default.json file with any available text editor to set your own secret token:\u00a0<\/p>\n<pre>{<br\/>\"services\": {<br\/>\"CoAuthoring\": {<br\/>\"secret\": {<br\/>\"inbox\": {<br\/>\"string\": \"mysecret\"<br\/>},<br\/>\"outbox\": {<br\/>\"string\": \"mysecret\"<br\/>},<br\/>},<br\/>\"token\": {<br\/>\"enable\": {<br\/>\"browser\": true,<br\/>\"request\": {<br\/>\"inbox\": true,<br\/>\"outbox\": true<br\/>}<br\/>}<br\/>}<br\/>}<br\/>}<br\/>}<\/pre>\n<p>Change the &#8220;mysecret&#8221; parameter and save the changes. Restart the services for the config changes to take effect:<\/p>\n<p class=\"command\">supervisorctl restart all<\/p>\n<p>Once saved, open the Nextcloud Admin settings, go to the ONLYOFFICE section and enter the same secret token to the appropriate field in the <strong>Advanced server settings<\/strong> section.<\/p>\n<p><a class=\"fancybox\" id=\"img-ONLYOFFICE-JWT-token\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_restrict_access_to_the_onlyoffice_editors_to_the_users_of_your_nextcloud_instance\/big\/ONLYOFFICE-JWT-token.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/how-to-restrict-access-to-the-onlyoffice-editors-to-the-users-of-your-nextcloud-instance.png\" alt=\"ONLYOFFICE JWT Token\" width=\"550\" height=\"276\" title=\"\"><\/a><\/p>\n<p>Finally save the changes, to enable JWT.<\/p>\n<div>\n<p><b>Share this page:<\/b><\/p>\n<p>\n<a href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fhow-to-restrict-access-to-the-onlyoffice-editors-to-the-users-of-your-nextcloud-instance%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/how-to-restrict-access-to-the-onlyoffice-editors-to-the-users-of-your-nextcloud-instance-1.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fhow-to-restrict-access-to-the-onlyoffice-editors-to-the-users-of-your-nextcloud-instance%2F&amp;text=How+to+restrict+access+to+the+ONLYOFFICE+editors+to+the+users+of+your+Nextcloud+instance&amp;via=howtoforgecom&amp;related=howtoforgecom\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/how-to-restrict-access-to-the-onlyoffice-editors-to-the-users-of-your-nextcloud-instance-2.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/howtoforgecom\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/how-to-restrict-access-to-the-onlyoffice-editors-to-the-users-of-your-nextcloud-instance-3.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/plus.google.com\/share?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fhow-to-restrict-access-to-the-onlyoffice-editors-to-the-users-of-your-nextcloud-instance%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/how-to-restrict-access-to-the-onlyoffice-editors-to-the-users-of-your-nextcloud-instance-4.png\" height=\"20\" alt=\"\" title=\"\"><\/a>\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Nextcloud\u00a0integrated with\u00a0ONLYOFFICE allows users to build a private cloud office on their own server and get a total control over the data stored there. To deploy and integrate them, just follow the instructions of this tutorial. Once you got your setup up and running, you may notice that ONLYOFFICE remains publicly accessible and can be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-5304","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/5304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=5304"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/5304\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=5304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=5304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=5304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}