I faced the following error while trying to get the authorization token.
The flow is the following:
- I’ve created an endpoint, which accepts GET/POST requests -
https://our-backend-redirect-url/
.
On POST It parses request.data and returns:
{
"pingData": {
"challenge": xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
}
}
- Also, i successfully created app via
https://api.smartthings.com/v1/apps/
with such payload:
{
"appName": "AppName",
"displayName": "displayName",
"description": "ST Integration",
"appType": "WEBHOOK_SMART_APP",
"classifications": [
"DEVICE"
],
"webhookSmartApp": {
"targetUrl": "https://our-backend-redirect-url/"
},
"oauth": {
"clientName": "clientNameOAuth",
"scope": [
"l:devices"
],
"redirectUris": [
"https://our-backend-redirect-url/"
]
}
}
-
After app creation i got app info. There i found
client_id
(something like: 123456-xxxx-xxxx-xxxx-xxxxxxxxxxxx). . -
And after that i’ve tried to get the authorization code by making request to this resourse:
https://api.smartthings.com/v1/oauth/authorize?client_id=123456-xxxx-xxxx-xxxx-xxxxxxxxxxxx&redirect_uri=https://our-backend-redirect-url/&response_type=code
, i got redirected to the Samsung’s login page. -
Logged-in and then the following page appeared:
-
I’ve pressed
Authorize
and on this moment i should’ve gotten the authorization code in the query parameters, but got this instead:
https://our-backend-redirect-url/?error=server_error&error_description=Unexpected+server+error.
So what am i doing wrong? PLease help me. Thank you in advance.