1

Has anyone managed to consume the Azure Service Management REST API from Android ?

What i have done :

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?
Community
  • 1
  • 1

1 Answers1

1

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).

Anže Vodovnik
  • 2,325
  • 16
  • 25
  • I have tried the C# example in .net . It worked (ofc), but i did not manage to find a similar example for Android. Response to Question : Because if someone else uses this app, they should be able to upload their own certificate. – Daniel Parlapan Aug 24 '11 at 07:39
  • Try running Fiddler if possible and see if there are any differences in endpoint or details of the connections. – Anže Vodovnik Aug 25 '11 at 05:34
  • I'm not really able to use fiddler because : -When i debug in emulator, the get request gets timed out.(the emulator must be having "trouble"). -When i debug on a device, fidller can't trace the request (ofc). – Daniel Parlapan Aug 25 '11 at 15:35
  • 1
    Then I suggest you take the code away from the project and get a Java App to work. Figure out if the cause is perhaps somewhere else... Eliminate everything else (emulator, OS)... – Anže Vodovnik Aug 25 '11 at 16:37
  • Thanks guys for your help. I managed to figure it out. The problem was the client certificate. The problem was the way i exported the .pfk and transforming it into a bks. I recommend using Portecle. – Daniel Parlapan Sep 01 '11 at 12:56
  • can anyone tell me how to solve this error (: 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.)? This happens when i try to load my image to android device. – Nagendra Hari Karthick Dec 22 '17 at 07:55