Forgot password for anonymous user

Since the plugin forgot password is not working anymore with jmix, I am trying to recreate a similar thing, but I found that EntityManager is not present in jmix, and I can get the users with userRepository, but I can’t wirte tables, because the only db provider I know in jmix is datamanager, and this one obviusly has security (like should be). There are another option to access persistence different to EntityManager, or another way of doinig this?, other pluign working in jmix similar to forgot password?.

PD: I want to have a table with the user and a token, so I will send a email to the user with the token and that link will allow change password for that user.

When you need to bypass security, use either UnconstrainedDataManager, or DataManager together with system authentication. See also data access checks table.

BTW, EntityManager works too, it can be injected into a bean using the standard @PersistenceContext annotation:

@PersistenceContext
protected EntityManager entityManager;

Yes, thank you I was already using unconstrainedDataManager and it works.