0

我正在为产品开发解决方案并尝试实现 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 App 中呈现的响应:

{ 
    "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

但回调返回 HTTP 401。

我已阅读此主题https://community.smartthings.com/t/cloud-to-cloud-oauth-rest-api/118902并没有找到解决方案。我在网上找不到更多有用的信息。

有人成功实施了吗?

支持很糟糕 - 几天没有回复。根据我之前的支持联系经验 - 他们可以在几周后回复......

谢谢!

4

1 回答 1

0

这是 iOS SmartThings 应用程序的错误,Android 工作正常。 https://community.smartthings.com/t/cant-implement-oauth-for-cloud-to-cloud/143258/7

于 2018-12-16T09:43:16.387 回答