Rest API Add-on configuration

Am having an issue after adding the rest api add-on and configuring the file with the clientId and clientsecret properties, on running I get the following error when I try and get a token.
“error”: “unauthorized”,
“error_description”: “There is no client authentication. Try adding an appropriate authentication filter.”

Is there a configuration am missing?

How do you get the token (request URL, headers, body)?
What Jmix version are you using?

The curl to get the auth token is as follows:
curl --location --request POST ‘http://localhost:8080/oauth/token/’ \

–header ‘Authorization: Basic Y2xpZW50OnNlY3JldA==’ \

–header ‘Content-Type: application/x-www-form-urlencoded’ \

–data-urlencode ‘grant_type=password’ \

–data-urlencode ‘username=admin’ \

–data-urlencode ‘password=*****’

Am using jmix version 1.2.2

It looks correct.

Do you have these dependencies in build.gradle?


Maybe you have some custom security configuration?

I have the dependencies configured. I do not have a custom security configuration. I have tested the same with a new project, one entity and the rest api addon configured with the settings as earlier indicated and I get same results.

If you have a test project, please attach it here. (279.6 KB)

Thanks for the project.
I’ve run it and got the token without any problems:

% curl -X POST http://localhost:8080/oauth/token \
   --basic --user client:secret \
   -H "Content-Type: application/x-www-form-urlencoded" \
   -d "grant_type=password&username=admin&password=admin"

Please make sure you use curl correctly. If you are on Windows, remove \ symbols and write the command in a single line.

Thanks very much