Unable to get an bearer token in a CURL call that used to work

Hello!

I have been using this code for a while to get a bearer token to then delete a file by file ID.

curl --request POST --header “Content-Type: application/json” --data “{“username":"xxxx@forscotland.com”,“password”:“xxxx”}” “https://forscotland.com:6443/api/2.0/authentication.json”

And the token response used to be in the body.

Now I just see

{“count”:1,“status”:0,“statusCode”:201,“response”:{“token”:null,“tfa”:true}}

It seems I authorize OK, but no token comes back.

The Document server has global MFA enabled including for the xxxx@forscotland.com user in the POST.

I recall 3 years back seeing something similar.

Do I need to alter the POST to get the token when the account I want the bearer token for is MFA protected?

onlyoffice-communityserver 12.7.1.1942

onlyoffice-controlpanel 3.5.4.541

onlyoffice-documentserver 9.3.1-10

Ubuntu 24.04 LTS

Many thanks for any pointers

Hello @ivan

I believe you are using Workspace, thus I’ve changed the category of this topic. Feel free to correct me.

Try specifying it as userName with a capital N.