Document security token is not correctly formed.

Integration questions/issues
Post Reply
iwouldntknow
Posts: 4
Joined: Sun Dec 08, 2019 1:03 am

Document security token is not correctly formed.

Post by iwouldntknow » Sat Feb 29, 2020 3:18 am

I'm keep getting "Document security token is not correctly formed" error.
Image

Am I missing something while passing token in config, from browser client to document server.

Config in JS


Token
Secret: test

/etc/onlyoffice/documentserver/local.json

Carl
Posts: 396
Joined: Thu Apr 12, 2018 10:00 am

Re: Document security token is not correctly formed.

Post by Carl » Mon Mar 02, 2020 8:01 am

Hello,

Are you using JWT in header or in body? Please try changing the header name from Authorization to AuthorizationJwt in local.json and in your request and check the result.

iwouldntknow
Posts: 4
Joined: Sun Dec 08, 2019 1:03 am

Re: Document security token is not correctly formed.

Post by iwouldntknow » Tue Mar 03, 2020 2:17 am

Looks like it was problem with wrong secret key.
Somehow secret from docker-compose.yml wasn't fully passed to document server's local.json config.

I didn't have to use AuthorizationJwt setting in config to make it work, but i am still wandering why where is no documentation about AuthorizationJwt setting.

Carl
Posts: 396
Joined: Thu Apr 12, 2018 10:00 am

Re: Document security token is not correctly formed.

Post by Carl » Tue Mar 03, 2020 7:11 am

It is not mandatory to set this header. Sometimes the Authorization header can be already taken by other applications, sometimes requests with this header are blocked. So I offered to change it and check the result. If it works with Authorization header, leave it be.

Post Reply