How to generate access token and idToken both in JWT format

You must pass an audience claim that is a registered API identifier in your Auth0 dashboard. Go to the dashboard, register and API, and use that identifier as the audience. You should have a JWT access token returned after that.