Keycloak adapter API example for resource owner password credentials grant

i am working on a trust client that need to authenticate user via the ‘resource owner password credentials’ grant. (in java)

from the keycloak i found little information (actually none) about using the adapter for this grant.

i know that i can use plain HTTP request to obtain the tokens… but the adapter do support some advanced features (e.g. JWKS, key rotation, renew refresh token after n usage, OIDC discovery…etc)

can anybody give me some hint about that?