Generate access tokens with custom permissions with no frontend

I am trying to generate access tokens. I have no frontend, only backend.
I have created an API, set roles/users/persmissions. And I can use the test connection option to login, but the test connection doesn’t generate a token.
I can generate one with my gmail account, but not with the users I created.
The token generated by my gmail account, is somehow faulty or not working. As it doesn’t get decoded properly by jwt.decode.
I tried a curl method and I keep getting an error.curl --request POST --url ‘https://fsnd-sami.auth0.com/oauth/token’ --header ‘content-type: application/x-www-form-urlencoded’ --data 'grant_type=password&username=exec-producer@casting.com&password=Test1234&audience=http://localhost:5000&client_id=I5gUe4LfoQY53aKDfYWczTOTou1v3oAd&client_secret=sLGRl2WA6MPSM1zhoh4XQuX3T7riTq_c5BcjxP9OMgAiShQG0fngJrBIJl74Q8JT’{“error”:“server_error”,“error_description”:"Authorization server not configured with default connection."}I tried the link method:Sign In with Auth0 And it worked one time, and ten I kept getting this following error:access_denied: Password login via OIDC-conformant clients with externally-hosted login pages is unsupported. Alternatively, login could have been initiated from the wrong place (e.g., a bookmark).

Hi!

You can set a default connection in the tenant settings of the Auth0 Dashboard.

The steps are documented here: Call Your API Using Resource Owner Password Flow
There is also a section that explains using realm support if you need to specify different connections

You will not be able to call the /login endpoint directly, it is meant for universal login from the Auth0 /Authorize endpoint.

Regards,

I have set the connection to password and set the directory to username-password-connection.