How to get JWT token with UID from back-end

I need to fetch JWT token from back-end which contains UID. How to do it?
I expect an opportunity to do some post request with grant_type: ‘password’. How to set up application which will handle it?


The following is documentation to the resource owner password grant flow.