Hello everyone,
My English is not very good, and this is my first time posting on the forum. I want to deploy OnlyOffice/DocumentServer using Docker. Here is the command I used:
docker run -d -p 8808:80 -e JWT_SECRET=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjp7ImMiOiJpbmZvIiwia2V5IjoiS2hpcno2elRQZGZkNyJ9fQ.hGQ8kquQWpg4MQYiSYaIzik0wotP1coAop6QfLruenA --name onlyoffice_documentserver onlyoffice/documentserver`
And here is my HTML code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div id="placeholder"></div>
<script type="text/javascript" src="http://192.168.31.158:8808/web-apps/apps/api/documents/api.js"></script>
<script>
var docEditor = new DocsAPI.DocEditor("placeholder", {
"document": {
"fileType": "docx",
"permissions": {
"edit": false,
},
"key": "Khirz6zTPdfd7",
"title": "zf.docx",
"url": "file:///C:/Users/MySNN/Desktop/test.docx"
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjp7ImMiOiJpbmZvIiwia2V5IjoiS2hpcno2elRQZGZkNyJ9fQ.hGQ8kquQWpg4MQYiSYaIzik0wotP1coAop6QfLruenA",
"height": "1000px",
"width": "100%"
})
</script>
</body>
</html>
When I run this code in the browser, I get an error saying, “The document security token is not correctly formed.” I understand that this is related to the JWT token, but after checking the relevant documentation, I don’t understand why I’m still encountering this issue even though I’ve added the JWT_SECRET parameter in the Docker startup command and included the token and key in the HTML code.
Thank you.