Skip to content

Commit 426b627

Browse files
committed
DOC-2583 Created New Folder for PHP JWT Authentication
1 parent 8ca221f commit 426b627

6 files changed

+81
-3
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-with-PHP.adoc[Export to PDF with JWT authentication (PHP)]
316+
**** JWT Authentication
317+
***** xref:export-to-pdf-with-jwt-authentication-with-PHP.adoc[Export to PDF with JWT authentication (PHP)]
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-with-PHP.adoc[Export to Word with JWT Authentication (PHP)]
320+
**** JWT Authentication
321+
***** xref:export-to-word-with-jwt-authentication-with-PHP.adoc[Export to Word with JWT Authentication (PHP)]
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:import-word-with-jwt-authentication-with-PHP.adoc[Import From Word with JWT Authentication (PHP)]
326+
**** JWT Authentication
327+
***** xref:import-word-with-jwt-authentication-with-PHP.adoc[Import From Word with JWT Authentication (PHP)]
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-with-PHP.adoc

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

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

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

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

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

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

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

modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc

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

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

61+
include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1]
62+
6163
include::partial$auth/document-converters/php/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 key 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. For example, to set the issue time to the current timestamp, calculate the issue time as the current timestamp divided by 1000.
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. 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+
----
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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.
2+
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.
3+
4+
There are two methods for generating and adding a public key to your API key:
5+
6+
@@ -7,7 +7,7 @@ There are two methods for generating and adding a public key to your API key:
7+
8+
== Generate a key pair using the {accountpage} JWT Keys page
9+
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.
11+
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.
12+
13+
[[generate-a-key-pair-locally]]
14+
== Generate a key pair locally

0 commit comments

Comments
 (0)