1 Reply Latest reply on Jan 31, 2018 9:58 AM by Andrew Waters

    /api/token: unsupported grant type

    Rémi Chaffard



      I face an issue with api trying to use token endpoint. Running this powershell works well:


      Invoke-WebRequest -Method POST -Headers @{Authorization="Basic XYZ"} -Body @{grant_type="password"} https://addm/api/token


      But this one does not:


      $json = @{grant_type="password"} | ConvertTo-Json
      Invoke-WebRequest -Method POST -Headers @{Authorization="Basic XYZ";Accept="application/json"} -Body $json https://addm/api/token


      This gives me the "unsupported grant type" error.

      The $json variable contains this:


          "grant_type":  "password"


      Maybe I miss a header or something but it seems sending data as JSON is not understood by ADDM.


      Can you please help ?