REST API 2.0 and OAuth Tokens

you need to get the APP KEY and APP SECRET from cayenne dashboard by clicking on Create app and Generate API Keys

where APP key == client_id and APP secret == client secret

to get access token:

curl --request POST \
  --url https://accounts.mydevices.com/auth/realms/cayenne/protocol/openid-connect/token \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'grant_type=password&client_id=<APP key>&client_secret=<APP Secret>&username=<email_id>&password=<password>'

For refresh token:

curl --request POST \
  --url https://accounts.mydevices.com/auth/realms/cayenne/protocol/openid-connect/token \
  --header 'content-type: application/x-www-form-urlencoded' \
  --cookie AWSALB=wI1Z6ev6AZiVtSkkhFBGv52I7ucgwMKzTo5KFdnXxYRrtQU1z68gqu81nxIkmsxILPkLuibLDf7ugr4hc5Qo5vyJcgk54T5%2Bjek6ssm5rmmrHDDFMTFYslts7dEu \
  --data 'grant_type=refresh_token&client_id=<APP Key> &client_secret=<APP Key>&refresh_token=<refresh_token>'
3 Likes