Skip to content

Commit 08d9423

Browse files
committed
DOC-2582: Update folder structure and naming, added JWT setup, fixed nav.adoc.
1 parent 1189280 commit 08d9423

File tree

6 files changed

+69
-5
lines changed

6 files changed

+69
-5
lines changed

modules/ROOT/nav.adoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,15 +313,18 @@
313313
*** xref:advtable.adoc[Enhanced Tables]
314314
*** xref:exportpdf.adoc[Export to PDF]
315315
**** xref:html-to-pdf-converter-api.adoc[HTML to PDF Converter API]
316-
**** xref:export-to-pdf-with-jwt-authentication-nodejs.adoc[Export to PDF with JWT authentication (Nodejs)]
316+
**** JWT Authentication
317+
***** xref:export-to-pdf-with-jwt-authentication-nodejs.adoc[NodeJS]
317318
*** xref:exportword.adoc[Export to Word]
318319
**** xref:html-to-docx-converter-api.adoc[HTML to DOCX Converter API]
319-
**** xref:export-to-word-with-jwt-authentication-nodejs.adoc[Export to Word with JWT authentication (Nodejs)]
320+
**** JWT Authentication
321+
***** xref:export-to-word-with-jwt-authentication-nodejs.adoc[NodeJS]
320322
*** xref:footnotes.adoc[Footnotes]
321323
*** xref:formatpainter.adoc[Format Painter]
322324
*** xref:importword.adoc[Import from Word]
323325
**** xref:docx-to-html-converter-api.adoc[DOCX to HTML Converter API]
324-
**** xref:importword-with-jwt-authentication-nodejs.adoc[Import from Word with JWT authentication (Nodejs)]
326+
**** JWT Authentication
327+
***** xref:importword-with-jwt-authentication-nodejs.adoc[NodeJS]
325328
*** xref:editimage.adoc[Image Editing]
326329
*** xref:inline-css.adoc[Inline CSS]
327330
*** xref:linkchecker.adoc[Link Checker]

modules/ROOT/pages/export-to-pdf-with-jwt-authentication-nodejs.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,6 @@ include::partial$auth/document-converters/initial-project-setup.adoc[]
6060

6161
include::partial$auth/document-converters/server-setup-jwt.adoc[]
6262

63+
include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1]
64+
6365
include::partial$auth/document-converters/configuration-steps.adoc[]

modules/ROOT/pages/export-to-word-with-jwt-authentication-nodejs.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,6 @@ include::partial$auth/document-converters/initial-project-setup.adoc[]
5858

5959
include::partial$auth/document-converters/server-setup-jwt.adoc[]
6060

61+
include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1]
62+
6163
include::partial$auth/document-converters/configuration-steps.adoc[]

modules/ROOT/pages/importword-with-jwt-authentication-nodejs.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,6 @@ include::partial$auth/document-converters/initial-project-setup.adoc[]
6060

6161
include::partial$auth/document-converters/server-setup-jwt.adoc[]
6262

63+
include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1]
64+
6365
include::partial$auth/document-converters/configuration-steps.adoc[]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[[setting-up-jwt-authentication]]
2+
== Setting up JWT authentication
3+
4+
To set up JSON Web Token (JWT) authentication for {productname} {pluginname}:
5+
6+
. Add a public ket to you {accountpage}, link:https://www.tiny.cloud/auth/login/[login].
7+
. Set up a JSON Web Token (JWT) Provider endpoint via link:{accountjwturl}[{accountpage} - JWT Keys]
8+
. Configure your {productname} to use the JWT endpoint.
9+
10+
include::partial$auth/private-public-key-pairs-for-tiny-cloud-services.adoc[]
11+
12+
[[set-up-a-json-web-token-jwt-endpoint]]
13+
== Set up a JSON Web Token (JWT) endpoint
14+
15+
include::partial$auth/how-jwts-are-used.adoc[]
16+
17+
=== JWT endpoint requirements
18+
19+
A JSON Web Token (JWT) endpoint for {pluginname} requires:
20+
21+
* The endpoint or server accepts a JSON HTTP POST request.
22+
* User authentication - A method of verifying the user, and that they should have access to the {pluginname}.
23+
* The JWTs are generated (signed) using the _private_ key that pairs with the _public_ key provided to link:{accountjwturl}[{accountpage} - JWT Keys].
24+
* The endpoint or server produces a JSON response with the token. {pluginname} will submit the token with requests to the {pluginname} Server.
25+
26+
=== Required JWT claims for {pluginname}
27+
28+
JSON Web Tokens produced by the JWT endpoint must include the following claims:
29+
30+
`+aud+` _(required)_::
31+
*Type:* `+String+`
32+
+
33+
The `aud` is case-sensitive string that must match a valid API key that has the {pluginname} plugin enabled.
34+
35+
`+iat+` _(required)_::
36+
*Type:* `+Number+`
37+
+
38+
The `iat` represents the issue timestamp, specified as the number of seconds since the Unix epoch. It indicates when the payload was generated.
39+
40+
.Example
41+
[source,json]
42+
----
43+
iat: Math.floor(Date.now() / 1000), // Issue timestamp
44+
----
45+
46+
`+exp+` _(required)_::
47+
*Type:* `+Number+`
48+
+
49+
The `exp` represents the expiration timestamp, specified as the number of seconds since the Unix epoch. It determines the time after which the payload is no longer valid. For example, to set a validity period of 10 minutes, calculate the expiration time as the current timestamp plus 600 seconds.
50+
51+
.Example
52+
[source,json]
53+
----
54+
exp: Math.floor(Date.now() / 1000) + (60 * 10) // Expiration time (10 minutes)
55+
----

modules/ROOT/partials/auth/private-public-key-pairs-for-tiny-cloud-services.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The {pluginname} Server requires a _public_ key generated from the same _private_ key that will be used on your JSON Web Token (JWT) provider endpoint. The public key(s) stored on the {pluginname} Server are used to ensure that content is sent by authorized users.
1+
The **{pluginname}** Server requires a _public_ key generated from the same _private_ key that will be used on your JSON Web Token (JWT) provider endpoint. The public key(s) stored on the {pluginname} Server are used to ensure that content is sent by authorized users.
22

33
There are two methods for generating and adding a public key to your API key:
44

@@ -7,7 +7,7 @@ There are two methods for generating and adding a public key to your API key:
77

88
== Generate a key pair using the {accountpage} JWT Keys page
99

10-
The link:{accountjwturl}[{accountpage} - JWT Keys] page provides a private/public key generator, providing a quick and secure way of generating the required keys. This generator will store a copy of the _public_ key, and provide a downloadable file for both the public and private keys. {companyname} does not store the _private_ key and the key pair cannot be retrieved later.
10+
The link:{accountjwturl}[{accountpage} - JWT Keys] page provides a private/public key generator, providing a quick and secure way of generating the required keys. This generator will store a copy of the _public_ key, and provide a downloadable file for both the public and private keys. {companyname} does **not store** the _private_ key and the key pair **cannot** be retrieved later.
1111

1212
[[generate-a-key-pair-locally]]
1313
== Generate a key pair locally

0 commit comments

Comments
 (0)