Geting token for Rest API throw exception

Hi,

I tested the rest api, added config in web-app.properties :

image

And use postman to get the token:

image
image

The server throws exception:
image

java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id “null”

Am i doing some thing wrong or missing some thing?

1 Like

Hi, since the 7.0 version the storage format for the cuba.rest.client.secret property has been changed. Now if you explicitly define the value of this property in your project you should specify a password encoder id, e.g.:

cuba.rest.client.secret={noop}secret

The details are in the GitHub issue

We’ll add an information about it to the documentation to make things more clear.

1 Like

Hi, Max

Thanks for your reply.

I added the {noop} prefix,now the server return a error message :

image

The user for login is the admin provided by system.

Parameters must be passed not in the URL but in the request body:
image

3 Likes

Oh, now i got!

Thanks a lot.

Hi, @gorbunkov

I have created a issue in GitHub.

There is already a issue about that there: Document the changes of the cuba.rest.client.secret property value · Issue #427 · cuba-platform/documentation · GitHub
This information was added to the documentation repository and will appear on the website soon