JMIX 1.2: Jmix-OIDC using rest api has some issues

Hi Team:

I have been able to use the rest api normally using this oidc addon.
However, When the backend is logged in through oidc, After using the Access token to access the REST API, the user table will have the same amount of data.
like this:

Does this behavior are bugs?



The problem is that different mechanisms are used for web login and for JWT bearer tokens.

The following application property says that the preffered_username claim will be used as Jmix user username:

For JWT access the “sub” claim is used as a username.

You have two options.

The first one is to remove the application property, then the “sub” claim will be used as a username by default when you login by web.

The second option is to use the preferred_username claim as a username for JWT access. For this you’ll need to define and configure your own JmixJwtAuthenticationConverter that will replace the standard one.

    public JmixJwtAuthenticationConverter jmixJwtAuthenticationConverter(OidcUserMapper oidcUserMapper) {
        JmixJwtAuthenticationConverter jmixJwtAuthenticationConverter = new JmixJwtAuthenticationConverter(oidcUserMapper);
        return jmixJwtAuthenticationConverter;

I’ve created in issue for this problem.