1

我有一个网络客户端,它与一个 .NET 网络服务通信,以获取各种家庭系统的数据和控制。我想通过 .NET 网络服务在网络客户端中公开巢恒温器控制。我了解典型的身份验证过程需要“用户”使用提供的“与嵌套一起工作”页面对客户端进行身份验证以获取代码,然后使用该代码获取令牌。在我的情况下,.NET web 服务是客户端,没有用户或 UI 允许用户“接受”,因此我需要一种方法来获取身份验证令牌(或 pin)而不在用户面前推送网页?这可能吗?谢谢

更新:我手动完成了生成令牌的过程,发现过期数字相当大(10 年)。鉴于这有什么理由我不能在我的 .NET 应用程序中使用该令牌来处理所有未来的休息调用吗?

4

2 回答 2

0

Just a note, if you're using a web service, specifically a SOAP service, then XML will be returned on the callback, not HTML. In the case of the nest API, JSON is returned.

In the case of oAuth, it's done on the lower level protocol of http using headers, URIs and the like. Here is the link to the standard:

https://www.rfc-editor.org/rfc/rfc5849

于 2014-09-06T16:36:00.973 回答
0

该令牌仅允许您访问批准帐户,因此如果此应用程序供您个人使用,那么是的,只需对令牌进行硬编码。

如果您的 .NET 服务可以处理 oAuth 回调(对于如何拥有无法提供 HTML 的 Web 服务有点困惑),那么您可以在 developer.nest.com 上的客户端设置中输入回调 URI,PIN 将为直接为您返回服务。回调 URI 必须以https://or开头http://localhost

于 2014-09-05T02:51:44.463 回答