Authorization server not configured with default connection

Problem statement

I received the

{“error”:“server_error”,“error_description”:“Authorization server not configured with default connection.”}

when calling the /token endpoint.

curl --request POST
–url ‘https://mydomain.auth0.com/oauth/token’
–header ‘content-type: application/x-www-form-urlencoded’
–data grant_type=password
–data ‘username=###EMAIL###’
–data ‘password=###PASSWORD###’
–data ‘client_id=###CLIENT_ID###’
–data ‘client_secret=###CLIENT_SECRET###’

Cause

According to the below doc, the ROPG flow needs the default directory set.
https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-resource-owner-password-flow#configure-tenant

Solution

Alternatively, if you have another connection as the default, you should be able to specify the active db connection this way: use the password-realm grant type and add an additional “realm” property to the call, which should be set to the database connection name you want to use.
https://auth0.com/docs/api/authentication#resource-owner-password