我正在为产品开发解决方案,并尝试实现C2C连接。我一直无法通过OAuth将SmartThings与我的后端链接。
我收到请求
{
"lifecycle": "CONFIGURATION",
"executionId": "41d224ba-7de3-77ac-fe87-a56fa6f325c3",
"locale": "en",
"version": "0.1.0",
"client": {
"os": "ios",
"version": "1.6.17",
"language": "uk"
},
"configurationData": {
"installedAppId": "7393625f-64d5-42cb-a52f-7935a677c4bb",
"phase": "PAGE",
"pageId": "linkPage",
"previousPageId": "",
"config": {}
},
"settings": {}
}
并返回在SmartThings应用程序中呈现的响应:
{
"configurationData": {
"page": {
"pageId": "linkPage",
"nextPageId": "",
"previousPageId": "",
"complete": true,
"name": "Account Linking",
"sections": [ {
"name": "Please, link SmartThings to your XXXXXX account",
"settings": [ {
"id": "linkAccount",
"name": "Link Account",
"type": "OAUTH",
"required": true,
"urlTemplate": "https://xxxxxx.auth.us-east-2.amazoncognito.com/login?response_type=code&client_id=20kucf9dcg5ju9deqeppugqft1&state=7393625f-64d5-42cb-a52f-7935a677c4bb&redirect_uri=https%3A%2F%2Fapi.smartthings.com%2Foauth%2Fcallback"
} ]
} ]
}
}
}
身份验证成功通过,并且将代码返回到回调,如下所示: https://api.smartthings.com/oauth/callback?code=9dfea1ca-54e8-47e8-ba90-24f20068ad2b&state=7393625f-64d5-42cb-a52f-7935a677c4bb
但是回调返回HTTP401。
我已阅读本主题https://community.smartthings.com/t/cloud-to-cloud-oauth-rest-api/118902,但没有找到解决方案。在网上找不到更多有用的信息。
有人成功实现了吗?
支持太糟糕了-几天没有回复。根据我以前的支持联系经验-他们可以在几周后回复...
谢谢!
答案 0 :(得分:0)
这是iOS SmartThings应用程序的错误,Android运行正常。 https://community.smartthings.com/t/cant-implement-oauth-for-cloud-to-cloud/143258/7