Android 上的 Azure 服务管理 REST
有人设法从 Android 使用 Azure 服务管理 REST API 吗?
我所做的:
- 将我自己的证书上传到天蓝色。
- 遵循并实施教程:http://blog. antoine.li/index.php/2010/10/android-trusting-ssl-certificates/ , 使用客户端/服务器证书进行双向身份验证 SSL Android 上的套接字 、信任通过 HTTPS 使用 HttpClient 的所有证书 、 http://www.howardism.org /Technical/Java/SelfSignedCerts.html(以及更多...)。
我在哪里:
- 我正在尝试发出请求以获取托管服务列表,但我收到 403 Forbidden 响应。(我相信服务器无法验证该请求)。
我要问的是:
- 任何人都可以告诉我使其正常工作的正确步骤吗?
Has anyone managed to consume the Azure Service Management REST API from Android ?
What i have done :
- Uploaded my own certificate to azure.
- Followed and implemented tutorials : http://blog.antoine.li/index.php/2010/10/android-trusting-ssl-certificates/ , Using client/server certificates for two way authentication SSL socket on Android , Trusting all certificates using HttpClient over HTTPS , http://www.howardism.org/Technical/Java/SelfSignedCerts.html (and more...).
Where i am at :
- I am trying to make a request to get a list of hosted services but i get a 403 Forbidden response.(i believe the server failed to authenticate the request).
What i ask :
- Can anyone please tell me the right steps to get it working?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不需要在设备上的链中拥有该证书。您需要加载它并将其添加到您发出的请求的标头中。
在 C# 中,我通过将证书存储为嵌入式资源、将字节加载到 X509Certificate2 类中并在 API 的 vrequest 中使用它来实现这一点。
问题:为什么设备上需要它?
更新:
您是否已将证书添加到管理证书中? :o) 澄清一下,有两种方法可以添加证书,一种是在托管服务、存储帐户和存储帐户下的管理证书中。 CDN。。确保将其添加到正确的订阅 ID 下,并确保使用正确的参数调用 HTTP(在我的例子中最常见的问题)。
You don't need to have that cert in the chain on the device. You need to load it and add it to the headers of the request you make.
In C#, I do that by storing the cert as an embedded resource, loading the bytes into a X509Certificate2 class and using that in thevrequest to the API.
Question: why do you need it on the device?
update:
Did you add the certificate to the management certificates? :o) Just to clarify, there are two ways you can add certificates, one is in the Management certificates under the Hosted Services, Storage Accounts & CDN. Make sure you add it under the correct subscription ID, and make sure you call the HTTP with the correct parameters (most commonly the problem in my case).