Parrot-Developers / node-flower-bridge

[Ble/Cloud bridge] Synchronize your Flower Powers with a raspberry. Now you can take holidays safely.
BSD 3-Clause "New" or "Revised" License
36 stars 21 forks source link

CODE: 400 invalid_request: missing 'grant_type' parameter #13

Closed TerrorSource closed 7 years ago

TerrorSource commented 7 years ago

Just installed to my Raspberry Pi 3b with builtin Bluetooth. It's able to scan for bluetooth devices and finds the 2 Parrot Flower Powers i have.

Running the "./bridge display" gives me an error:

pi@raspberrypi:~/node-flower-bridge $ sudo ./bridge display

-- Flower Bridge --

[---] No program is running
node /home/pi/node-flower-bridge/start.js
POST/urlencoded /user/v3/authenticate
client_id: username@gmail.com
client_secret: secretkeylinehere
username: username@gmail.com
password: xxx
grant_type: password
app_identifier:
{ headers:
   { 'Content-Type': 'application/x-www-form-urlencoded',
     Authorization: '' },
  body: 'client_id=username%40gmail.com&client_secret=secretkeylinehere&username=username%40gmail.com&password=xxx&grant_type=password&app_identifier=',
  url: 'https://api-flower-power-pot.parrot.com/user/v3/authenticate/user/v3/authenticate',
  method: 'POST' }
✔ Login!
GET/urlencoded /garden/v2/configuration
{ headers:
   { 'Content-Type': 'application/x-www-form-urlencoded',
     Authorization: 'Bearer WQ9CVvJJCosMlyNvClkFpsEMKvnLHPi5x0QYnLgYFihRHcLI' },
  body: '',
  url: 'https://api-flower-power-pot.parrot.com/user/v3/authenticate/garden/v2/configuration',
  method: 'GET' }
GET/urlencoded /user/v4/profile
{ headers:
   { 'Content-Type': 'application/x-www-form-urlencoded',
     Authorization: 'Bearer WQ9CVvJJCosMlyNvClkFpsEMKvnLHPi5x0QYnLgYFihRHcLI' },
  body: '',
  url: 'https://api-flower-power-pot.parrot.com/user/v3/authenticate/user/v4/profile',
  method: 'GET' }
[DATE-TIME]: CODE: 400
invalid_request: missing 'grant_type' parameter
TerrorSource commented 7 years ago

Found the issue already :)

credentials.json: { "client_id": "emailadresregistered@api", "client_secret": "secretapikey", "username": "emailaddressregistered@app", "password": "password@app", "url": "https://api-flower-power-pot.parrot.com" }