From 9d6a47c816f639cf5eaadd8f05d340b376904aae Mon Sep 17 00:00:00 2001 From: Lewis Hickson Date: Tue, 26 Nov 2024 13:46:43 +1000 Subject: [PATCH 01/28] Documentation for the JWT Authentication in relation to Document Exporters and Importers --- modules/ROOT/nav.adoc | 3 + ...-pdf-with-jwt-authentication-with-PHP.adoc | 62 ++++++++++++++++++ ...word-with-jwt-authentication-with-PHP.adoc | 63 +++++++++++++++++++ ...word-with-jwt-authentication-with-PHP.adoc | 62 ++++++++++++++++++ .../php/configuration-steps.adoc | 26 ++++++++ .../php/initial-project-setup.adoc | 49 +++++++++++++++ .../php/intro-and-prerequisites.adoc | 33 ++++++++++ .../php/server-setup-php.adoc | 47 ++++++++++++++ 8 files changed, 345 insertions(+) create mode 100644 modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc create mode 100644 modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc create mode 100644 modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc create mode 100644 modules/ROOT/partials/auth/document-converters/php/configuration-steps.adoc create mode 100644 modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc create mode 100644 modules/ROOT/partials/auth/document-converters/php/intro-and-prerequisites.adoc create mode 100644 modules/ROOT/partials/auth/document-converters/php/server-setup-php.adoc diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index 47b1c49a5a..de0f525e6b 100644 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -313,12 +313,15 @@ *** xref:advtable.adoc[Enhanced Tables] *** xref:exportpdf.adoc[Export to PDF] **** xref:html-to-pdf-converter-api.adoc[HTML to PDF Converter API] +**** xref:export-to-pdf-with-jwt-authentication-with-PHP.adoc[Export to PDF with JWT authentication (PHP)] *** xref:exportword.adoc[Export to Word] **** xref:html-to-docx-converter-api.adoc[HTML to DOCX Converter API] +**** xref:export-to-word-with-jwt-authentication-with-PHP.adoc[Export to Word with JWT Authentication (PHP)] *** xref:footnotes.adoc[Footnotes] *** xref:formatpainter.adoc[Format Painter] *** xref:importword.adoc[Import from Word] **** xref:docx-to-html-converter-api.adoc[DOCX to HTML Converter API] +**** xref:import-word-with-jwt-authentication-with-PHP.adoc[Import From Word with JWT Authentication (PHP)] *** xref:editimage.adoc[Image Editing] *** xref:inline-css.adoc[Inline CSS] *** xref:linkchecker.adoc[Link Checker] diff --git a/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc b/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc new file mode 100644 index 0000000000..fced637f8d --- /dev/null +++ b/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc @@ -0,0 +1,62 @@ += Export to PDF with JWT authentication (PHP) Guide +:navtitle: JWT Authentication setup for Export to PDF +:description: Guide on how to setup JWT Authentication for exporting PDF files with {productname} +:keywords: jwt, authentication, exportpdf, pdf, php +:pluginname: Export to PDF +:plugincode: exportpdf + +include::partial$auth/document-converters/php/intro-and-prerequisites.adoc[] + +include::partial$auth/document-converters/php/initial-project-setup.adoc[] + +. Inside the `public` folder where you created the `index.html` file add the HTML setup code (refer to the *Setting up {productname} HTML* section). + +==== Web Page Setup (index.html) + +[source,html] +---- + + + + TinyMCE with PDF Export + + + + +

TinyMCE Export to PDF Demo

+ + + +---- + +. In the root directory, copy and paste the server setup code into the `jwt.php` file. + +include::partial$auth/document-converters/php/server-setup-php.adoc[] + +include::partial$auth/document-converters/php/configuration-steps.adoc[] \ No newline at end of file diff --git a/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc new file mode 100644 index 0000000000..073ec072dc --- /dev/null +++ b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc @@ -0,0 +1,63 @@ += Export to Word with JWT authentication (PHP) Guide +:navtitle: JWT Authentication setup for Export to Word +:description: Guide on how to setup JWT Authentication for exporting Word files with {productname} +:keywords: jwt, authentication, exportword, word, php +:pluginname: Export to Word +:plugincode: exportword + +include::partial$auth/document-converters/php/intro-and-prerequisites.adoc[] + +include::partial$auth/document-converters/php/initial-project-setup.adoc[] + + +. Inside the `public` folder where you created the `index.html` file add the HTML setup code (refer to the *Setting up {productname} HTML* section). + +==== Web Page Setup (index.html) + +[source,html] +---- + + + + TinyMCE with Word Export + + + + +

TinyMCE Export to Word Demo

+ + + +---- + +. In the root directory, copy and paste the server setup code into the `jwt.php` file. + +include::partial$auth/document-converters/php/server-setup-php.adoc[] + +include::partial$auth/document-converters/php/configuration-steps.adoc[] \ No newline at end of file diff --git a/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc b/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc new file mode 100644 index 0000000000..e5a4dec2b6 --- /dev/null +++ b/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc @@ -0,0 +1,62 @@ += Import Word to TinyMCE Editor with JWT authentication (PHP) Guide +:navtitle: JWT Authentication setup for Import Word to TinyMCE Edtior +:description: Guide on how to setup JWT Authentication for importing Word files with {productname} +:keywords: jwt, authentication, importword, word, php +:pluginname: Import from Word +:plugincode: importword + +include::partial$auth/document-converters/php/intro-and-prerequisites.adoc[] + +include::partial$auth/document-converters/php/initial-project-setup.adoc[] + +. Inside the `public` folder where you created the `index.html` file add the HTML setup code (refer to the *Setting up {productname} HTML* section). + +==== Web Page Setup (index.html) + +[source,html] +---- + + + + TinyMCE with Word Import + + + + +

TinyMCE Import Word Demo

+ + + +---- + +. In the root directory, copy and paste the server setup code into the `jwt.php` file. + +include::partial$auth/document-converters/php/server-setup-php.adoc[] + +include::partial$auth/document-converters/php/configuration-steps.adoc[] \ No newline at end of file diff --git a/modules/ROOT/partials/auth/document-converters/php/configuration-steps.adoc b/modules/ROOT/partials/auth/document-converters/php/configuration-steps.adoc new file mode 100644 index 0000000000..cb588ca3a5 --- /dev/null +++ b/modules/ROOT/partials/auth/document-converters/php/configuration-steps.adoc @@ -0,0 +1,26 @@ +=== Configuration Steps + +==== 1. Add Your API Key + +* Replace `YOUR-API-KEY` in both files with your actual {productname} API key +* The API key should be the same in both the HTML script source and the JWT payload + +==== 2. Add Your Private Key + +* Replace the private key placeholder in `jwt.php` with your actual private key +* Make sure it's in `PKCS8` format +* Keep this key secure and never share it publicly + +=== Running Your Project + +. Start the server: ++ +[source,bash] +---- +php -S localhost:3000 +---- + +. Open your browser to: `http://localhost:3000` +. You should see: +* The {productname} editor +* An "{pluginname}" button in the toolbar \ No newline at end of file diff --git a/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc b/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc new file mode 100644 index 0000000000..ded74afd2a --- /dev/null +++ b/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc @@ -0,0 +1,49 @@ +== Update PHP php.ini Files + +Update files inside the downloaded php package: + +* php.ini +* php.ini-development +* php.ini-production + +Ensure the following lines are uncommented: + +[source, bash] +---- +extension=openssl +extension_dir={Depends on your development environment} +---- + +== Quick Start Guide + +=== Project Setup (5 minutes) + +[source,bash] +---- +# Create and enter project directory +mkdir tinymce-app +cd tinymce-app +# Initialize Composer +composer require firebase/php-jwt +---- + +=== Create Project Structure + +[source,bash] +---- +# Create the public folder for your web files +touch index.html +touch jwt.php +---- + +Your project should look like this: + +[source] +---- +/tinymce-app + index.html (TinyMCE webpage) + jwt.php (Server code) + composer + composer.lock + vendor +---- diff --git a/modules/ROOT/partials/auth/document-converters/php/intro-and-prerequisites.adoc b/modules/ROOT/partials/auth/document-converters/php/intro-and-prerequisites.adoc new file mode 100644 index 0000000000..00fc1c376a --- /dev/null +++ b/modules/ROOT/partials/auth/document-converters/php/intro-and-prerequisites.adoc @@ -0,0 +1,33 @@ +== Introduction + +{pluginname} requires setting up JSON Web Token (JWT) authentication to maintain control over file security. A JWT endpoint generates and provides authorization tokens that verify submitted content is sent by authorized users, preventing unauthorized access. As a standard web services authorization solution, JWT is documented extensively at link:https://jwt.io/[https://jwt.io/]. + +This guide provides a comprehensive walkthrough for integrating {pluginname} with {productname}, including {pluginname} functionality, by using a PHP server for JWT token generation. It covers project setup, server configuration, and {productname} customization. + +== What You'll Build + +Before diving into the technical details, here's what you'll achieve with this guide: + +* A working {productname} editor running {pluginname} plugin. +* A secure authentication system using JWT tokens +* A simple PHP server to handle the authentication + +[TIP] +==== +This guide is designed for developers new to JWT authentication and {productname} integration. +==== + +=== Prerequisites + +Before starting, ensure you have: + +* PHP installed on your computer +* OpenSSL is installed on your computer +* Composer is installed on your computer +* A {productname} API key (get one from link:https://www.tiny.cloud/signup[TinyMCE's website]) +* Basic familiarity with the command line + +[IMPORTANT] +==== +Make sure you have your API key ready before starting. You'll need it for both the server and client configuration. +==== \ No newline at end of file diff --git a/modules/ROOT/partials/auth/document-converters/php/server-setup-php.adoc b/modules/ROOT/partials/auth/document-converters/php/server-setup-php.adoc new file mode 100644 index 0000000000..1b5cca8df1 --- /dev/null +++ b/modules/ROOT/partials/auth/document-converters/php/server-setup-php.adoc @@ -0,0 +1,47 @@ +==== Server Setup (jwt.php) + +[source,php] +---- + "JWT auth failed: " . $message))); +} + +// Check for OpenSSL extension +if (!extension_loaded('openssl')) { + fatalError('You need to enable the openssl extension in your php.ini.'); +} + +// Enable CORS +header("Access-Control-Allow-Origin: *"); +header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept"); + +// JWT payload +$payload = array( + "aud" => "YOUR-API-KEY-HERE", + "iat" => time(), // Issue timestamp + "exp" => time() + 60 * 10 // Expiration time (10 minutes) +); + +try { + // Tokens are signed with the RS256 algorithm your private key + $privateKey = << $token)); +} catch (Exception $e) { + fatalError($e->getMessage()); +} +?> +---- \ No newline at end of file From e5237649d1308ce236cefff366bc6d5921adb411 Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Wed, 27 Nov 2024 10:37:43 +1000 Subject: [PATCH 02/28] DOC-2582 Removed Service URL for ExportPDF --- .../pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc b/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc index fced637f8d..78e9aaca4a 100644 --- a/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc +++ b/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc @@ -35,7 +35,6 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] 'margin_bottom': '1in', 'margin_left': '1in' }, - exportpdf_service_url: "", // export_token_provider fetches a token from the `/jwt.php` endpoint. exportpdf_token_provider: () => { return fetch('http://localhost:3000/jwt.php', { @@ -59,4 +58,4 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] include::partial$auth/document-converters/php/server-setup-php.adoc[] -include::partial$auth/document-converters/php/configuration-steps.adoc[] \ No newline at end of file +include::partial$auth/document-converters/php/configuration-steps.adoc[] From 9137ff8107a420980e2b237a60241049fadd4a3f Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Wed, 27 Nov 2024 10:39:14 +1000 Subject: [PATCH 03/28] DOC-2583 Removed Service URL for Export to Word --- .../pages/export-to-word-with-jwt-authentication-with-PHP.adoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc index 073ec072dc..3f82d1b025 100644 --- a/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc +++ b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc @@ -36,7 +36,6 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] 'margin_bottom': '1in', 'margin_left': '1in' }, - exportword_service_url: "", // export_token_provider fetches a token from the `/jwt.php` endpoint. exportword_token_provider: () => { return fetch('http://localhost:3000/jwt.php', { @@ -60,4 +59,4 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] include::partial$auth/document-converters/php/server-setup-php.adoc[] -include::partial$auth/document-converters/php/configuration-steps.adoc[] \ No newline at end of file +include::partial$auth/document-converters/php/configuration-steps.adoc[] From 8ca221fd2f457bf169d22b53f28ead36853bc468 Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Wed, 27 Nov 2024 10:40:27 +1000 Subject: [PATCH 04/28] DOC-2583 Removed Service URL for Import Word --- .../pages/import-word-with-jwt-authentication-with-PHP.adoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc b/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc index e5a4dec2b6..b642d3ae21 100644 --- a/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc +++ b/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc @@ -35,7 +35,6 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] 'margin_bottom': '1in', 'margin_left': '1in' }, - importword_service_url: "", // import_token_provider fetches a token from the `/jwt.php` endpoint. importword_token_provider: () => { return fetch('http://localhost:3000/jwt.php', { @@ -59,4 +58,4 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] include::partial$auth/document-converters/php/server-setup-php.adoc[] -include::partial$auth/document-converters/php/configuration-steps.adoc[] \ No newline at end of file +include::partial$auth/document-converters/php/configuration-steps.adoc[] From 426b627e1e96621ecd64e62b077f0892de974738 Mon Sep 17 00:00:00 2001 From: Lewis Hickson Date: Thu, 28 Nov 2024 15:45:15 +1000 Subject: [PATCH 05/28] DOC-2583 Created New Folder for PHP JWT Authentication --- modules/ROOT/nav.adoc | 9 ++- ...-pdf-with-jwt-authentication-with-PHP.adoc | 2 + ...word-with-jwt-authentication-with-PHP.adoc | 2 + ...word-with-jwt-authentication-with-PHP.adoc | 2 + .../jwt-setup-document-converters.adoc | 55 +++++++++++++++++++ ...lic-key-pairs-for-tiny-cloud-services.adoc | 14 +++++ 6 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 modules/ROOT/partials/auth/document-converters/jwt-setup-document-converters.adoc create mode 100644 modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index de0f525e6b..29a121b208 100644 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -313,15 +313,18 @@ *** xref:advtable.adoc[Enhanced Tables] *** xref:exportpdf.adoc[Export to PDF] **** xref:html-to-pdf-converter-api.adoc[HTML to PDF Converter API] -**** xref:export-to-pdf-with-jwt-authentication-with-PHP.adoc[Export to PDF with JWT authentication (PHP)] +**** JWT Authentication +***** xref:export-to-pdf-with-jwt-authentication-with-PHP.adoc[Export to PDF with JWT authentication (PHP)] *** xref:exportword.adoc[Export to Word] **** xref:html-to-docx-converter-api.adoc[HTML to DOCX Converter API] -**** xref:export-to-word-with-jwt-authentication-with-PHP.adoc[Export to Word with JWT Authentication (PHP)] +**** JWT Authentication +***** xref:export-to-word-with-jwt-authentication-with-PHP.adoc[Export to Word with JWT Authentication (PHP)] *** xref:footnotes.adoc[Footnotes] *** xref:formatpainter.adoc[Format Painter] *** xref:importword.adoc[Import from Word] **** xref:docx-to-html-converter-api.adoc[DOCX to HTML Converter API] -**** xref:import-word-with-jwt-authentication-with-PHP.adoc[Import From Word with JWT Authentication (PHP)] +**** JWT Authentication +***** xref:import-word-with-jwt-authentication-with-PHP.adoc[Import From Word with JWT Authentication (PHP)] *** xref:editimage.adoc[Image Editing] *** xref:inline-css.adoc[Inline CSS] *** xref:linkchecker.adoc[Link Checker] diff --git a/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc b/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc index 78e9aaca4a..483e380a4a 100644 --- a/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc +++ b/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc @@ -58,4 +58,6 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] include::partial$auth/document-converters/php/server-setup-php.adoc[] +include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1] + include::partial$auth/document-converters/php/configuration-steps.adoc[] diff --git a/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc index 3f82d1b025..15763cb4a8 100644 --- a/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc +++ b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc @@ -59,4 +59,6 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] include::partial$auth/document-converters/php/server-setup-php.adoc[] +include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1] + include::partial$auth/document-converters/php/configuration-steps.adoc[] diff --git a/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc b/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc index b642d3ae21..8bba11bfb4 100644 --- a/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc +++ b/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc @@ -58,4 +58,6 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] include::partial$auth/document-converters/php/server-setup-php.adoc[] +include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1] + include::partial$auth/document-converters/php/configuration-steps.adoc[] diff --git a/modules/ROOT/partials/auth/document-converters/jwt-setup-document-converters.adoc b/modules/ROOT/partials/auth/document-converters/jwt-setup-document-converters.adoc new file mode 100644 index 0000000000..24810aa8c9 --- /dev/null +++ b/modules/ROOT/partials/auth/document-converters/jwt-setup-document-converters.adoc @@ -0,0 +1,55 @@ +[[setting-up-jwt-authentication]] +== Setting up JWT authentication + +To set up JSON Web Token (JWT) authentication for {productname} {pluginname}: + +. Add a public key to you {accountpage}, link:https://www.tiny.cloud/auth/login/[login]. +. Set up a JSON Web Token (JWT) Provider endpoint via link:{accountjwturl}[{accountpage} - JWT Keys] +. Configure your {productname} to use the JWT endpoint. + +include::partial$auth/private-public-key-pairs-for-tiny-cloud-services.adoc[] + +[[set-up-a-json-web-token-jwt-endpoint]] +== Set up a JSON Web Token (JWT) endpoint + +include::partial$auth/how-jwts-are-used.adoc[] + +=== JWT endpoint requirements + +A JSON Web Token (JWT) endpoint for {pluginname} requires: + +* The endpoint or server accepts a JSON HTTP POST request. +* User authentication - A method of verifying the user, and that they should have access to the {pluginname}. +* The JWTs are generated (signed) using the _private_ key that pairs with the _public_ key provided to link:{accountjwturl}[{accountpage} - JWT Keys]. +* The endpoint or server produces a JSON response with the token. {pluginname} will submit the token with requests to the {pluginname} Server. + +=== Required JWT claims for {pluginname} + +JSON Web Tokens produced by the JWT endpoint must include the following claims: + +`+aud+` _(required)_:: +*Type:* `+String+` ++ +The `aud` is case-sensitive string that must match a valid API key that has the {pluginname} plugin enabled. + +`+iat+` _(required)_:: +*Type:* `+Number+` ++ +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. + +.Example +[source,json] +---- +iat: Math.floor(Date.now() / 1000), // Issue timestamp +---- + +`+exp+` _(required)_:: +*Type:* `+Number+` ++ +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. + +.Example +[source,json] +---- +exp: Math.floor(Date.now() / 1000) + (60 * 10) // Expiration time (10 minutes) +---- \ No newline at end of file diff --git a/modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc b/modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc new file mode 100644 index 0000000000..4c54ef7ebe --- /dev/null +++ b/modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc @@ -0,0 +1,14 @@ +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. +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. + +There are two methods for generating and adding a public key to your API key: + +@@ -7,7 +7,7 @@ There are two methods for generating and adding a public key to your API key: + +== Generate a key pair using the {accountpage} JWT Keys page + +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. +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. + +[[generate-a-key-pair-locally]] +== Generate a key pair locally \ No newline at end of file From 4b656675863dfda609f2bb46c5e3efd62e4b3f00 Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Thu, 28 Nov 2024 15:51:16 +1000 Subject: [PATCH 06/28] Update modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc Co-authored-by: Karl Kemister-Sheppard --- .../pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc b/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc index 483e380a4a..90d69cc4f5 100644 --- a/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc +++ b/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc @@ -35,7 +35,7 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] 'margin_bottom': '1in', 'margin_left': '1in' }, - // export_token_provider fetches a token from the `/jwt.php` endpoint. + // exportpdf_token_provider fetches a token from the `/jwt.php` endpoint. exportpdf_token_provider: () => { return fetch('http://localhost:3000/jwt.php', { method: 'POST', From 9ce78e0eca90e23cce88e99fa2f1c458bc376485 Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Thu, 28 Nov 2024 15:51:36 +1000 Subject: [PATCH 07/28] Update modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc Co-authored-by: Karl Kemister-Sheppard --- .../pages/import-word-with-jwt-authentication-with-PHP.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc b/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc index 8bba11bfb4..21b5b9e4eb 100644 --- a/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc +++ b/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc @@ -1,4 +1,4 @@ -= Import Word to TinyMCE Editor with JWT authentication (PHP) Guide += Import to Word with JWT authentication (PHP) Guide :navtitle: JWT Authentication setup for Import Word to TinyMCE Edtior :description: Guide on how to setup JWT Authentication for importing Word files with {productname} :keywords: jwt, authentication, importword, word, php From 9917294788abbb4bda3ca6e1c4c627cd1acf1d2c Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Thu, 28 Nov 2024 15:51:48 +1000 Subject: [PATCH 08/28] Update modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc Co-authored-by: Karl Kemister-Sheppard --- .../pages/export-to-word-with-jwt-authentication-with-PHP.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc index 15763cb4a8..506ff512f6 100644 --- a/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc +++ b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc @@ -36,7 +36,7 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] 'margin_bottom': '1in', 'margin_left': '1in' }, - // export_token_provider fetches a token from the `/jwt.php` endpoint. + // exportword_token_provider fetches a token from the `/jwt.php` endpoint. exportword_token_provider: () => { return fetch('http://localhost:3000/jwt.php', { method: 'POST', From f3600c02d55cf55f656ec570c7fa38f0a86503ec Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Thu, 28 Nov 2024 15:51:54 +1000 Subject: [PATCH 09/28] Update modules/ROOT/partials/auth/document-converters/php/intro-and-prerequisites.adoc Co-authored-by: Farzad Hayat --- .../auth/document-converters/php/intro-and-prerequisites.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ROOT/partials/auth/document-converters/php/intro-and-prerequisites.adoc b/modules/ROOT/partials/auth/document-converters/php/intro-and-prerequisites.adoc index 00fc1c376a..e5b34d05c5 100644 --- a/modules/ROOT/partials/auth/document-converters/php/intro-and-prerequisites.adoc +++ b/modules/ROOT/partials/auth/document-converters/php/intro-and-prerequisites.adoc @@ -22,8 +22,8 @@ This guide is designed for developers new to JWT authentication and {productname Before starting, ensure you have: * PHP installed on your computer -* OpenSSL is installed on your computer -* Composer is installed on your computer +* OpenSSL installed on your computer +* Composer installed on your computer * A {productname} API key (get one from link:https://www.tiny.cloud/signup[TinyMCE's website]) * Basic familiarity with the command line From 23f9b4251cd525a6a56f52244eb3d023151e4cf8 Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Thu, 28 Nov 2024 15:53:25 +1000 Subject: [PATCH 10/28] Update modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc Co-authored-by: Karl Kemister-Sheppard --- .../pages/import-word-with-jwt-authentication-with-PHP.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc b/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc index 21b5b9e4eb..30b673f325 100644 --- a/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc +++ b/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc @@ -35,7 +35,7 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] 'margin_bottom': '1in', 'margin_left': '1in' }, - // import_token_provider fetches a token from the `/jwt.php` endpoint. + // importword_token_provider fetches a token from the `/jwt.php` endpoint. importword_token_provider: () => { return fetch('http://localhost:3000/jwt.php', { method: 'POST', From 1c852e6fe7398742d068f65302594ce06ce17643 Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Thu, 28 Nov 2024 16:08:22 +1000 Subject: [PATCH 11/28] Rename export-to-word-with-jwt-authentication-with-PHP.adoc to export-to-word-with-jwt-authentication-with-php.adoc --- ....adoc => export-to-word-with-jwt-authentication-with-php.adoc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/ROOT/pages/{export-to-word-with-jwt-authentication-with-PHP.adoc => export-to-word-with-jwt-authentication-with-php.adoc} (100%) diff --git a/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc similarity index 100% rename from modules/ROOT/pages/export-to-word-with-jwt-authentication-with-PHP.adoc rename to modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc From 33ffa77e77ea45aac36ecc825ce081b6a1a6e7f7 Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Thu, 28 Nov 2024 16:08:47 +1000 Subject: [PATCH 12/28] DOC-2583 Rename export-to-pdf-with-jwt-authentication-with-PHP.adoc to export-to-pdf-with-jwt-authentication-with-php.adoc --- ...P.adoc => export-to-pdf-with-jwt-authentication-with-php.adoc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/ROOT/pages/{export-to-pdf-with-jwt-authentication-with-PHP.adoc => export-to-pdf-with-jwt-authentication-with-php.adoc} (100%) diff --git a/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc b/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-php.adoc similarity index 100% rename from modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-PHP.adoc rename to modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-php.adoc From 21cc32e7eaaddd5b8ec6121f10bdf6f7651e63e1 Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Thu, 28 Nov 2024 16:09:21 +1000 Subject: [PATCH 13/28] DOC-2583 Rename import-word-with-jwt-authentication-with-PHP.adoc to import-word-with-jwt-authentication-with-php.adoc --- ...PHP.adoc => import-word-with-jwt-authentication-with-php.adoc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/ROOT/pages/{import-word-with-jwt-authentication-with-PHP.adoc => import-word-with-jwt-authentication-with-php.adoc} (100%) diff --git a/modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc b/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc similarity index 100% rename from modules/ROOT/pages/import-word-with-jwt-authentication-with-PHP.adoc rename to modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc From 3a6b0a79517a5c0575e0a35849622967bc276de0 Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Thu, 28 Nov 2024 16:10:28 +1000 Subject: [PATCH 14/28] DOC-2583 Update nav.adoc to match new page titles --- modules/ROOT/nav.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index 29a121b208..20d1a64ea3 100644 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -314,17 +314,17 @@ *** xref:exportpdf.adoc[Export to PDF] **** xref:html-to-pdf-converter-api.adoc[HTML to PDF Converter API] **** JWT Authentication -***** xref:export-to-pdf-with-jwt-authentication-with-PHP.adoc[Export to PDF with JWT authentication (PHP)] +***** xref:export-to-pdf-with-jwt-authentication-with-php.adoc[Export to PDF with JWT authentication (PHP)] *** xref:exportword.adoc[Export to Word] **** xref:html-to-docx-converter-api.adoc[HTML to DOCX Converter API] **** JWT Authentication -***** xref:export-to-word-with-jwt-authentication-with-PHP.adoc[Export to Word with JWT Authentication (PHP)] +***** xref:export-to-word-with-jwt-authentication-with-php.adoc[Export to Word with JWT Authentication (PHP)] *** xref:footnotes.adoc[Footnotes] *** xref:formatpainter.adoc[Format Painter] *** xref:importword.adoc[Import from Word] **** xref:docx-to-html-converter-api.adoc[DOCX to HTML Converter API] **** JWT Authentication -***** xref:import-word-with-jwt-authentication-with-PHP.adoc[Import From Word with JWT Authentication (PHP)] +***** xref:import-word-with-jwt-authentication-with-php.adoc[Import From Word with JWT Authentication (PHP)] *** xref:editimage.adoc[Image Editing] *** xref:inline-css.adoc[Inline CSS] *** xref:linkchecker.adoc[Link Checker] From 61f91db2ee647ca60d6bbc264dd0488454614ee0 Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Tue, 3 Dec 2024 09:59:29 +1000 Subject: [PATCH 15/28] Update modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-php.adoc Co-authored-by: Karl Kemister-Sheppard --- ...rt-to-pdf-with-jwt-authentication-with-php.adoc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-php.adoc b/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-php.adoc index 90d69cc4f5..f0ab40945f 100644 --- a/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-php.adoc +++ b/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-php.adoc @@ -11,6 +11,14 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] . Inside the `public` folder where you created the `index.html` file add the HTML setup code (refer to the *Setting up {productname} HTML* section). +== Setup + +include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1] + +. In the root directory, copy and paste the server setup code into the `jwt.php` file. + +include::partial$auth/document-converters/php/server-setup-php.adoc[] + ==== Web Page Setup (index.html) [source,html] @@ -54,10 +62,4 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] ---- -. In the root directory, copy and paste the server setup code into the `jwt.php` file. - -include::partial$auth/document-converters/php/server-setup-php.adoc[] - -include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1] - include::partial$auth/document-converters/php/configuration-steps.adoc[] From 679c01b66e5101969e368ec33a350e6d8287ecfb Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Tue, 3 Dec 2024 09:59:38 +1000 Subject: [PATCH 16/28] Update modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc Co-authored-by: Karl Kemister-Sheppard --- ...t-to-word-with-jwt-authentication-with-php.adoc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc index 506ff512f6..94580742db 100644 --- a/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc +++ b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc @@ -12,6 +12,14 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] . Inside the `public` folder where you created the `index.html` file add the HTML setup code (refer to the *Setting up {productname} HTML* section). +== Setup + +include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1] + +. In the root directory, copy and paste the server setup code into the `jwt.php` file. + +include::partial$auth/document-converters/php/server-setup-php.adoc[] + ==== Web Page Setup (index.html) [source,html] @@ -55,10 +63,4 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] ---- -. In the root directory, copy and paste the server setup code into the `jwt.php` file. - -include::partial$auth/document-converters/php/server-setup-php.adoc[] - -include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1] - include::partial$auth/document-converters/php/configuration-steps.adoc[] From c9a4f61b51ee9fbcb76ea158856ca6677c38a878 Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Tue, 3 Dec 2024 09:59:50 +1000 Subject: [PATCH 17/28] Update modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc Co-authored-by: Karl Kemister-Sheppard --- ...port-word-with-jwt-authentication-with-php.adoc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc b/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc index 30b673f325..392fc030a2 100644 --- a/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc +++ b/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc @@ -11,6 +11,14 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] . Inside the `public` folder where you created the `index.html` file add the HTML setup code (refer to the *Setting up {productname} HTML* section). +== Setup + +include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1] + +. In the root directory, copy and paste the server setup code into the `jwt.php` file. + +include::partial$auth/document-converters/php/server-setup-php.adoc[] + ==== Web Page Setup (index.html) [source,html] @@ -54,10 +62,4 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] ---- -. In the root directory, copy and paste the server setup code into the `jwt.php` file. - -include::partial$auth/document-converters/php/server-setup-php.adoc[] - -include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1] - include::partial$auth/document-converters/php/configuration-steps.adoc[] From 553bdf593af23628689f6f6f5da931f873e136bb Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Tue, 3 Dec 2024 10:00:02 +1000 Subject: [PATCH 18/28] Update modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc Co-authored-by: Karl Kemister-Sheppard --- .../auth/document-converters/php/initial-project-setup.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc b/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc index ded74afd2a..6846049da6 100644 --- a/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc +++ b/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc @@ -16,7 +16,7 @@ extension_dir={Depends on your development environment} == Quick Start Guide -=== Project Setup (5 minutes) +=== Project Setup [source,bash] ---- From 0806c988a6c683f0cf0be52c225c0069e417e8d8 Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Tue, 3 Dec 2024 10:00:10 +1000 Subject: [PATCH 19/28] Update modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc Co-authored-by: Karl Kemister-Sheppard --- .../private-public-key-pairs-for-tiny-cloud-services.adoc | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc b/modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc index 4c54ef7ebe..649566cd1d 100644 --- a/modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc +++ b/modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc @@ -1,5 +1,4 @@ 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. -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. There are two methods for generating and adding a public key to your API key: From 5b5bfe9a435793fdaf785e284c1a771cb022f2da Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Tue, 3 Dec 2024 10:00:17 +1000 Subject: [PATCH 20/28] Update modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc Co-authored-by: Karl Kemister-Sheppard --- .../private-public-key-pairs-for-tiny-cloud-services.adoc | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc b/modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc index 649566cd1d..2b25466cbd 100644 --- a/modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc +++ b/modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc @@ -2,8 +2,6 @@ The {pluginname} Server requires a _public_ key generated from the same _private There are two methods for generating and adding a public key to your API key: -@@ -7,7 +7,7 @@ There are two methods for generating and adding a public key to your API key: - == Generate a key pair using the {accountpage} JWT Keys page 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. From e30162f853173d026c1a72a5aa37ac474c611eab Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Tue, 3 Dec 2024 10:00:25 +1000 Subject: [PATCH 21/28] Update modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc Co-authored-by: Karl Kemister-Sheppard --- .../private-public-key-pairs-for-tiny-cloud-services.adoc | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc b/modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc index 2b25466cbd..62b3b6f9e3 100644 --- a/modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc +++ b/modules/ROOT/partials/private-public-key-pairs-for-tiny-cloud-services.adoc @@ -4,7 +4,6 @@ There are two methods for generating and adding a public key to your API key: == Generate a key pair using the {accountpage} JWT Keys page -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. 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. [[generate-a-key-pair-locally]] From 54f9d44b6f069febe81ea83dfe7918bd269a4efa Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Tue, 3 Dec 2024 10:00:33 +1000 Subject: [PATCH 22/28] Update modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-php.adoc Co-authored-by: Karl Kemister-Sheppard --- .../pages/export-to-pdf-with-jwt-authentication-with-php.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-php.adoc b/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-php.adoc index f0ab40945f..9c7ca45bb3 100644 --- a/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-php.adoc +++ b/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-php.adoc @@ -1,4 +1,4 @@ -= Export to PDF with JWT authentication (PHP) Guide += {pluginname} with JWT authentication (PHP) Guide :navtitle: JWT Authentication setup for Export to PDF :description: Guide on how to setup JWT Authentication for exporting PDF files with {productname} :keywords: jwt, authentication, exportpdf, pdf, php From 9010dc120cce1905e0417f9058c9e8bd1b56ef92 Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Tue, 3 Dec 2024 10:00:40 +1000 Subject: [PATCH 23/28] Update modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc Co-authored-by: Karl Kemister-Sheppard --- .../pages/export-to-word-with-jwt-authentication-with-php.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc index 94580742db..66539ec4ba 100644 --- a/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc +++ b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc @@ -1,4 +1,4 @@ -= Export to Word with JWT authentication (PHP) Guide += {pluginname} with JWT authentication (PHP) Guide :navtitle: JWT Authentication setup for Export to Word :description: Guide on how to setup JWT Authentication for exporting Word files with {productname} :keywords: jwt, authentication, exportword, word, php From aabd35f2eaea4f8407bc55aa4108c09df5f2dfef Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Tue, 3 Dec 2024 10:00:47 +1000 Subject: [PATCH 24/28] Update modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc Co-authored-by: Karl Kemister-Sheppard --- .../pages/import-word-with-jwt-authentication-with-php.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc b/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc index 392fc030a2..f84bfcf182 100644 --- a/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc +++ b/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc @@ -1,4 +1,4 @@ -= Import to Word with JWT authentication (PHP) Guide += {pluginname} with JWT authentication (PHP) Guide :navtitle: JWT Authentication setup for Import Word to TinyMCE Edtior :description: Guide on how to setup JWT Authentication for importing Word files with {productname} :keywords: jwt, authentication, importword, word, php From 8c9daab155dc1412fa718dca44ad195a7527c0e7 Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Mon, 9 Dec 2024 10:45:53 +1000 Subject: [PATCH 25/28] Update modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc Co-authored-by: Farzad Hayat --- .../auth/document-converters/php/initial-project-setup.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc b/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc index 6846049da6..a50b85cde3 100644 --- a/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc +++ b/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc @@ -43,7 +43,7 @@ Your project should look like this: /tinymce-app index.html (TinyMCE webpage) jwt.php (Server code) - composer + composer.json composer.lock vendor ---- From c449ddbfad1b6a9c037196d5812425e4000d6f0f Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Mon, 9 Dec 2024 15:15:13 +1000 Subject: [PATCH 26/28] DOC-2583: Farzad/Lewis structural improvements --- ...-pdf-with-jwt-authentication-with-php.adoc | 10 ++++----- ...word-with-jwt-authentication-with-php.adoc | 9 +++----- ...word-with-jwt-authentication-with-php.adoc | 8 +++---- .../php/initial-project-setup.adoc | 21 +++++++++++-------- .../php/intro-and-prerequisites.adoc | 6 +++--- .../php/server-setup-php.adoc | 4 +++- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-php.adoc b/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-php.adoc index 9c7ca45bb3..782042a134 100644 --- a/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-php.adoc +++ b/modules/ROOT/pages/export-to-pdf-with-jwt-authentication-with-php.adoc @@ -9,17 +9,17 @@ include::partial$auth/document-converters/php/intro-and-prerequisites.adoc[] include::partial$auth/document-converters/php/initial-project-setup.adoc[] -. Inside the `public` folder where you created the `index.html` file add the HTML setup code (refer to the *Setting up {productname} HTML* section). - == Setup -include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1] +=== Generate a Public/Private Key Pair -. In the root directory, copy and paste the server setup code into the `jwt.php` file. +include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+2] include::partial$auth/document-converters/php/server-setup-php.adoc[] -==== Web Page Setup (index.html) +=== Web Page Setup (index.html) + +Inside the `public` folder where you created the `index.html` file add the HTML setup code: [source,html] ---- diff --git a/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc index 66539ec4ba..2b20580c48 100644 --- a/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc +++ b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc @@ -9,19 +9,16 @@ include::partial$auth/document-converters/php/intro-and-prerequisites.adoc[] include::partial$auth/document-converters/php/initial-project-setup.adoc[] - -. Inside the `public` folder where you created the `index.html` file add the HTML setup code (refer to the *Setting up {productname} HTML* section). - == Setup -include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1] - -. In the root directory, copy and paste the server setup code into the `jwt.php` file. +include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+2] include::partial$auth/document-converters/php/server-setup-php.adoc[] ==== Web Page Setup (index.html) +Inside the `public` folder where you created the `index.html` file add the HTML setup code: + [source,html] ---- diff --git a/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc b/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc index f84bfcf182..bd4fe8e3f8 100644 --- a/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc +++ b/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc @@ -9,18 +9,16 @@ include::partial$auth/document-converters/php/intro-and-prerequisites.adoc[] include::partial$auth/document-converters/php/initial-project-setup.adoc[] -. Inside the `public` folder where you created the `index.html` file add the HTML setup code (refer to the *Setting up {productname} HTML* section). - == Setup -include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+1] - -. In the root directory, copy and paste the server setup code into the `jwt.php` file. +include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+2] include::partial$auth/document-converters/php/server-setup-php.adoc[] ==== Web Page Setup (index.html) +Inside the `public` folder where you created the `index.html` file add the HTML setup code: + [source,html] ---- diff --git a/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc b/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc index a50b85cde3..6abc6979c8 100644 --- a/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc +++ b/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc @@ -1,19 +1,22 @@ -== Update PHP php.ini Files +== Update PHP Configuration File -Update files inside the downloaded php package: +Use the following command to locate the PHP configuration file: -* php.ini -* php.ini-development -* php.ini-production +[source,bash] +---- +php --ini +---- -Ensure the following lines are uncommented: +Open the configuration file in a text editor and ensure the following settings are enabled: -[source, bash] +[source,ini] ---- extension=openssl -extension_dir={Depends on your development environment} +extension_dir='ext' ---- +The path to the extension directory may vary depending on your system. + == Quick Start Guide === Project Setup @@ -42,7 +45,7 @@ Your project should look like this: ---- /tinymce-app index.html (TinyMCE webpage) - jwt.php (Server code) + jwt.php (Server code) composer.json composer.lock vendor diff --git a/modules/ROOT/partials/auth/document-converters/php/intro-and-prerequisites.adoc b/modules/ROOT/partials/auth/document-converters/php/intro-and-prerequisites.adoc index e5b34d05c5..e7767130e8 100644 --- a/modules/ROOT/partials/auth/document-converters/php/intro-and-prerequisites.adoc +++ b/modules/ROOT/partials/auth/document-converters/php/intro-and-prerequisites.adoc @@ -21,9 +21,9 @@ This guide is designed for developers new to JWT authentication and {productname Before starting, ensure you have: -* PHP installed on your computer -* OpenSSL installed on your computer -* Composer installed on your computer +* PHP installed on your computer (to check, run `php -v` in your terminal) +* OpenSSL installed on your computer (to check, run `openssl version` in your terminal) +* Composer installed on your computer (to check, run `composer -v` in your terminal) * A {productname} API key (get one from link:https://www.tiny.cloud/signup[TinyMCE's website]) * Basic familiarity with the command line diff --git a/modules/ROOT/partials/auth/document-converters/php/server-setup-php.adoc b/modules/ROOT/partials/auth/document-converters/php/server-setup-php.adoc index 1b5cca8df1..3bce388289 100644 --- a/modules/ROOT/partials/auth/document-converters/php/server-setup-php.adoc +++ b/modules/ROOT/partials/auth/document-converters/php/server-setup-php.adoc @@ -1,4 +1,6 @@ -==== Server Setup (jwt.php) +=== Server Setup (jwt.php) + +In the root directory, copy and paste the server setup code into the `jwt.php` file: [source,php] ---- From 26c5e1ed5e27cdfe213d2b88602acd7fdef79994 Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Tue, 10 Dec 2024 13:47:33 +1000 Subject: [PATCH 27/28] DOC-2583: Farzad/Lewis fix import/export docx nav structure --- .../export-to-word-with-jwt-authentication-with-php.adoc | 4 +++- .../pages/import-word-with-jwt-authentication-with-php.adoc | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc index 2b20580c48..ccaa016435 100644 --- a/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc +++ b/modules/ROOT/pages/export-to-word-with-jwt-authentication-with-php.adoc @@ -11,11 +11,13 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] == Setup +=== Generate a Public/Private Key Pair + include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+2] include::partial$auth/document-converters/php/server-setup-php.adoc[] -==== Web Page Setup (index.html) +=== Web Page Setup (index.html) Inside the `public` folder where you created the `index.html` file add the HTML setup code: diff --git a/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc b/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc index bd4fe8e3f8..d70c6e9567 100644 --- a/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc +++ b/modules/ROOT/pages/import-word-with-jwt-authentication-with-php.adoc @@ -1,5 +1,5 @@ = {pluginname} with JWT authentication (PHP) Guide -:navtitle: JWT Authentication setup for Import Word to TinyMCE Edtior +:navtitle: JWT Authentication setup for Import from Word :description: Guide on how to setup JWT Authentication for importing Word files with {productname} :keywords: jwt, authentication, importword, word, php :pluginname: Import from Word @@ -11,11 +11,13 @@ include::partial$auth/document-converters/php/initial-project-setup.adoc[] == Setup +=== Generate a Public/Private Key Pair + include::partial$auth/document-converters/jwt-setup-document-converters.adoc[leveloffset=+2] include::partial$auth/document-converters/php/server-setup-php.adoc[] -==== Web Page Setup (index.html) +=== Web Page Setup (index.html) Inside the `public` folder where you created the `index.html` file add the HTML setup code: From 18186c4c07292f89e2f391e84947eedf195c815e Mon Sep 17 00:00:00 2001 From: LewisAtTiny Date: Wed, 11 Dec 2024 08:41:39 +1000 Subject: [PATCH 28/28] Update modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc Co-authored-by: Karl Kemister-Sheppard --- .../auth/document-converters/php/initial-project-setup.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc b/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc index 6abc6979c8..5240d90c8b 100644 --- a/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc +++ b/modules/ROOT/partials/auth/document-converters/php/initial-project-setup.adoc @@ -15,6 +15,7 @@ extension=openssl extension_dir='ext' ---- +[TIP] The path to the extension directory may vary depending on your system. == Quick Start Guide