Is there a way to obtain id_token programatically? The purpose is to test our API…flow is : front-end uses Auth0 to get an id_token then we are using delegation to get AWS tokens.
It is possible, although under specific circumstances. In particular, if you a database connection end-user then you can exchange the username and password for tokens through an endpoint that does not require end-user interaction and as such can be performed programatically.
Given you’re using the legacy delegation flows you should take a look at the also legacy /oauth/ro
endpoint which allows to perform the exchange described above. Have in mind that even if your production users only use social authentication you can consider having a database connection in your test tenant/domain so that you can perform such programmatic tests.