Fix API password grant type authentication
Merge pull request #681 from nlegoff/api_auth_fix

[3.8] Fix API authentification