Client Side Certificate in Metro for Windows Azure Service Management

I am trying to connect to the Windows Azure Service Management API. I must provide a certificate that I previously uploaded to my azure portal. In .NET, this is very simple, as described in detail here . However, in Metro, you cannot manually attach a certificate to a request. On the Microsoft forum, I found this:

HttpClientHandler aHandler = new HttpClientHandler(); aHandler.ClientCertificateOptions = ClientCertificateOption.Automatic; HttpClient aClient = new HttpClient(aHandler); HttpResponseMessage aResp = await aClient.GetAsync("https://[azure service management uri]"); 

Together with giving applications the ability to use common certificates, this should select a certificate or provide the user with the opportunity to choose a certificate. The certificate is in my personal store, and I even tried to include the certificate in the package manifest, but nothing works. Looks like it just does not include the certificate in the request.

What is the correct way to call a REST-based API that needs a certificate in a Metro application?

+6
source share
1 answer

I think I have an answer to this question. Please check the certificate that you use to authenticate your requests. There should be 2 things in this certificate:

  • Make sure "Client Authentication" is included as one of the goals of the certificate.

  • Verify that the certificate is set to "OID".

I wrote a blog post about consuming the Windows Azure Window Management API in a Windows 8 application, which you can read here: http://gauravmantri.com/2012/09/08/consuming-windows-azure-service-management-api-in -a-windows-8-application / . I touched on these two questions, and then a few more.

Hope this helps.

+6
source

Source: https://habr.com/ru/post/924053/


All Articles