[3.8] Fix #1670 API password grant type authentication is broken