Skip to content

Commit 2dc0cb4

Browse files
committed
doc: Improve documentation regarding Etherpad authentication
1 parent af645ea commit 2dc0cb4

File tree

1 file changed

+68
-16
lines changed

1 file changed

+68
-16
lines changed

README.md

Lines changed: 68 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@ In order to make Ownpad work, go to the configuration panel (Settings /
1616
Admininstration / Additional Settings) and fill in the necessary data
1717
within the “Ownpad (collaborative documents)” section.
1818

19-
**Set a Etherpad Host:**
20-
To be able to process the document, you must configure a Host. [Find more public providers at the Etherpad-Lite wiki](https://github.com/ether/etherpad-lite/wiki/Sites-that-run-Etherpad-Lite)
19+
**Set a Etherpad Host:** To be able to process the document, you must
20+
configure a Host. [Find more public providers at the Etherpad-Lite
21+
wiki](https://github.com/ether/etherpad-lite/wiki/Sites-that-run-Etherpad-Lite)
2122

2223
*Example:*
2324
* Etherpad Host https://etherpad.wikimedia.org/
2425
* Ethercalc Host https://ethercalc.net/
2526

26-
Note that most browsers will only display the content if both Nextcloud and Etherpad/Ethercalc are served via HTTPS.
27+
Note that most browsers will only display the content if both
28+
Nextcloud and Etherpad/Ethercalc are served via HTTPS.
2729

2830
Afterwards, the “pad” and/or “calc” items will be available in the “+”
2931
menu from the “File” app.
@@ -59,7 +61,12 @@ Then, you should add the following content in the `/config/mimetypemapping.json`
5961
}
6062
```
6163

62-
For the [snap-distribution of Nextcloud](https://github.com/nextcloud/nextcloud-snap) the template file can be found under `/snap/nextcloud/current/htdocs/resources/config/mimetypemapping.dist.json` and the active config-folder by default is `/var/snap/nextcloud/current/nextcloud/config/`.
64+
For the [snap-distribution of
65+
Nextcloud](https://github.com/nextcloud/nextcloud-snap) the template
66+
file can be found under
67+
`/snap/nextcloud/current/htdocs/resources/config/mimetypemapping.dist.json`
68+
and the active config-folder by default is
69+
`/var/snap/nextcloud/current/nextcloud/config/`.
6370

6471
Then you should copy the MIME type icons from Ownpad to the Nextcloud core:
6572

@@ -91,19 +98,18 @@ Ownpad. If this is used then the user will simply be prompted to enter
9198
login credentials by their browser when they try to access a pad from
9299
within Nextcloud.
93100

94-
### Etherpad-managed auth
101+
### Etherpad-managed Authentication
95102

96103
Ownpad supports communication with the Etherpad API for access
97-
restriction (so called *protected pads*). This support is considered
98-
**experimental** due to work in progress; some features are still
99-
missing. See the [TODO.md](TODO.md) for details.
104+
restriction (so called *protected pads*).
100105

101106
Protected pads need to be accessed via Nextcloud in order to gain access
102107
privileges.
103108

104-
In order for this to work, you’ll need to enter your Etherpad API key
105-
within the Ownpad settings. You can find your API key in the
106-
`APIKEY.txt` file of your Etherpad instance.
109+
In order for this to work, you’ll need to enter your Etherpad API
110+
credentials (either the API key for Etherpad 1.x or the client
111+
ID/client secret for Etherpad 2.x). Please refer to the next section
112+
to find out how to configure Etherpad.
107113

108114
In addition you’ll need to host your Etherpad and Nextcloud instances
109115
under the same domain. For example, you can host your Etherpad in
@@ -112,14 +118,60 @@ example, you’ll have to set the cookie domain to `example.org` within
112118
the Ownpad settings.
113119

114120
If you want to create *truly* private pads, you have to dedicate an
115-
Etherpad instance for Nextcloud **running both with HTTPS**. You will then configure Etherpad to
116-
restrict pad access via sessions and pad creation via the API.
117-
For this, you have to adjust your Etherpad configuration file
118-
(`settings.json`) as following:
121+
Etherpad instance for Nextcloud **running both with HTTPS**. You will
122+
then configure Etherpad to restrict pad access via sessions and pad
123+
creation via the API. For this, you have to adjust your Etherpad
124+
configuration file (`settings.json`) as following:
119125

126+
```json
127+
{
128+
# …
120129
"requireSession" : true,
121130
"editOnly" : true,
131+
}
132+
```
133+
134+
#### Etherpad Authentication
135+
136+
If you are using Etherpad 1.x, then authentication is using a single
137+
API key secret. You can find your API key in the `APIKEY.txt` file of
138+
your Etherpad instance. This API key should be put in Ownpad settings.
139+
140+
If you are using Etherpad 2.x (at least 2.0.3 is required), then, you
141+
should first configure your Etherpad’s `settings.json` file to add a
142+
new service account. You should give that account admin
143+
credentials. You should add the following snippet (you should adjust
144+
`client_id` and `client_secret` to strong values):
145+
146+
```json
147+
{
148+
# …
149+
"sso": {
150+
# …
151+
"clients": [
152+
# …
153+
{
154+
"client_id": "client_id",
155+
"redirect_uris": [],
156+
"response_types": [],
157+
"grant_types": ["client_credentials"],
158+
"client_secret": "client_secret",
159+
"extraParams": [
160+
{
161+
"name": "admin",
162+
"value": "true"
163+
}
164+
]
165+
}
166+
]
167+
}
168+
}
169+
```
170+
171+
Then, you should push that secrets in Ownpad configuration after
172+
having enabled the OAuth2 authentication mode.
122173

123174
## License
124175

125-
The code is licensed under the AGPLv3 which can be found as the file [COPYING](COPYING) in the source code repository.
176+
The code is licensed under the AGPLv3 which can be found as the file
177+
[COPYING](COPYING) in the source code repository.

0 commit comments

Comments
 (0)