The document security token is not correctly formed. Token is correct

Hello!

I’ve installed your Docker image Docker (I believe it’s the CE version - I think it would be nice to include its proper name somewhere in the dockerhub too :smiley: ).

The OnlyOffice runs fine on localhost:80.

Question: wrong token even if it’s not wrong?

When I try to retrieve the JWT token I’m getting it out properly:

sudo docker exec {containerId} /var/www/onlyoffice/documentserver/npm/json -f /etc/onlyoffice/documentserver/local.json 'services.CoAuthoring.secret.session.string'
Password:
yk9iSRlsQvTFngJYAHBr

But when I try to run OnlyOffice in React like this:

<DocumentEditor
id=“docxEditor”
documentServerUrl=“localhost:80”
config={{
document: {
fileType: “docx”,
key: “yk9iSRlsQvTFngJYAHBr”,
title: “Example Document Title.docx”,
url: “localhost:80/test.docx”,
},
documentType: “word”,
}}
events_onDocumentReady={onDocumentReady}
/>

I get: The document security token is not correctly formed. Please contact your Document Server administrator. Note localhost:80/test.docx does not exist as I can’t save any documents @ localhost:80 (nor can’t create anything outside of “Example” - see the Extra Question below).

Any idea what might be the issue here? My local.json file has inbox/outbox/browser token set to “true” and secret for inbox/outbox/session is indeed “yk9iSRlsQvTFngJYAHBr”.

What am I missing here?

Extra question.

When I go to localhost:80 should I be able to create new documents? Because right now all I can do is to generate test example which kinda works but “Save” button is inactive for some reason (volumes are mounted properly):

save

Thanks for any hints.

Note I had to remove “http://” from links as the forum allows only for 2 links per post for new users. My URLs (mainly the ones starting with “localhost”) actually start with a “http://” :slight_smile:

Hello @Mike1

I’ve installed your Docker image Docker (I believe it’s the CE version - I think it would be nice to include its proper name somewhere in the dockerhub too :smiley: ).

You’ve chosen the right repository, this is Community Edition. Enterprise and Developers editions are here:
https://hub.docker.com/r/onlyoffice/documentserver-ee/tags
https://hub.docker.com/r/onlyoffice/documentserver-de/tags

<DocumentEditor
id=“docxEditor”
documentServerUrl=“localhost:80”
config={{
document: {
fileType: “docx”,
key: “yk9iSRlsQvTFngJYAHBr”,
title: “Example Document Title.docx”,
url: “localhost:80/test.docx”,
},
documentType: “word”,
}}
events_onDocumentReady={onDocumentReady}
/>

Why do you use JWT secret as document.key value? As independent integrator you have to generate key on your own for each editing session. Probably these links will be useful:

As for JWT in general, please make sure that enabled JWT on both sides (Document server and your storage). If it doesn’t help, please reproduce the issue and send us whole Document server logs folder. it’s located here: /app/onlyoffice/DocumentServer/logs/documentserver/

When I go to localhost:80 should I be able to create new documents? Because right now all I can do is to generate test example which kinda works but “Save” button is inactive for some reason (volumes are mounted properly):

Do you mean integrated example? This is expected behavior for integrated example. The ForceSave mechanism is disabled by default there. This is related link: ONLYOFFICE Api Documentation - Saving File

Thank you @Alexandre I decided to start new thread that explains my case a bit better, maybe this could be included in docs as I feel like my issue might be quite common: How to build basic MVP with standalone Onlyoffice?