简体   繁体   English

如何使用 ReadyApi 配置 Azure IOT 中心

[英]How to configure Azure IOT central with ReadyApi

We are using ourname.我们正在使用我们的名字。 azureiotcentral .com/ and ReadyApi 3.5.0 azureiotcentral .com/ 和ReadyApi 3.5.0

在 Azure 物联网中心

An access token we created on the azureiotcentral website looks like this:我们在 azureiotcentral 网站上创建的访问令牌如下所示:

SharedAccessSignature sr=739023aa-a2d4-4cc1-8044-0447586f622a&sig=teSPECIMENmawBMI0QUA5b%2BJ%2BDdhuie7JSTA%2BggltI0E%3D&skn=specimen&se=1635585779999

Now back in ReadyApi, which one do we choose as authentication?现在回到 ReadyApi,我们选择哪一个作为身份验证?

在此处输入图片说明

next question is: and how do you know which one to choose?下一个问题是:你怎么知道选择哪一个? https://docs.microsoft.com/nl-nl/rest/api/iotcentral/devices/getcredentials https://docs.microsoft.com/nl-nl/rest/api/iotcentral/devices/getcredentials

asuming it is ... OAuth 2.0 (Azure)假设它是... OAuth 2.0 (Azure)

Then how do you know the profile name?那怎么知道profile名称呢?

and is the token started from the SharedAccess part or before the sr= or only the part after the sr=?令牌是从SharedAccess部分开始还是在 sr= 之前或仅在 sr= 之后的部分开始? and why is there a spacebar in the token?为什么令牌中有空格键? (in short: how to format?) (简而言之:如何格式化?)


I tried this: But then the respons is something with cookies.我试过这个:但后来的反应是饼干。 How do I know what browser is tested/tried?我怎么知道测试/尝试过什么浏览器? 在此处输入图片说明

(today: A colleague told me he thought it was the bearer option) (今天:一位同事告诉我他认为这是不记名的选择)

According to https://docs.microsoft.com/en-us/learn/modules/manage-iot-central-apps-with-rest-api/3-exercise-authorize-api , the shared access signature goes in the "Authorization" header as-is without the "Bearer" prefix.根据https://docs.microsoft.com/en-us/learn/modules/manage-iot-central-apps-with-rest-api/3-exercise-authorize-api ,共享访问签名进入“授权”标头按原样不带“承载”前缀。 I'm not sure what option that corresponds to in ReadyApi, but it might be easier to remove the authentication option and just add it manually as a header named "Authorization".我不确定 ReadyApi 对应哪个选项,但删除身份验证选项可能更容易,只需将其手动添加为名为“Authorization”的标头。

在此处输入图片说明

in the field VALUE you paste the complete token, including "SharedAccessSignature" and including the spacebar before the sr=!在 VALUE 字段中,您粘贴完整的令牌,包括“SharedAccessSignature”和 sr=! 之前的空格键! (and yes without the Bearer, thanks Scott) that's it. (是的,没有承载,谢谢斯科特)就是这样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM