You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

65 lines
1.9 KiB

= {pluginname} with JWT authentication (PHP) Guide
: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
:plugincode: importword
include::partial$auth/document-converters/php/intro-and-prerequisites.adoc[]
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)
Inside the `public` folder where you created the `index.html` file add the HTML setup code.
[source,html]
----
<!DOCTYPE html>
<html>
<head>
<title>TinyMCE with Word Import</title>
<script
src="https://cdn.tiny.cloud/1/no-api-key/tinymce/8/tinymce.min.js"
referrerpolicy="origin">
</script>
<script>
tinymce.init({
selector: 'textarea',
plugins: 'importword',
toolbar: 'importword',
importword_converter_options: {
'format': 'Letter',
'margin_top': '1in',
'margin_right': '1in',
'margin_bottom': '1in',
'margin_left': '1in'
},
// importword_token_provider fetches a token from the `/jwt.php` endpoint.
importword_token_provider: () => {
return fetch('http://localhost:3000/jwt.php', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
}).then(response => response.json());
},
});
</script>
</head>
<body>
<h1>TinyMCE Import Word Demo</h1>
<textarea>
Welcome to TinyMCE! Try the Import from Word feature.
</textarea>
</body>
</html>
----
include::partial$auth/document-converters/php/configuration-steps.adoc[]