none
Problem with Authorization using Rest API RRS feed

  • Question

  • Following the document :https://msdn.microsoft.com/en-us/library/windows/hardware/dn800660(v=vs.85).aspx

    I am using scope as : https://devicesigningservice.cloudapp.net/

    to get the valid token from Access control server.When I pass that token in header to get SAS URI in third step I am getting 

    HttpResponseProxy{HTTP/1.1 500 Internal Server Error 

    Json used: 

    		StringEntity params =new StringEntity("{\"TestHarnessType\": \"HLK\",\"OSSelections\": [{\"OS\",\"Windows 7\"},{\"OS\",\"Windows 8\"},{\"OS\",\"Windows 8.1\"},{\"OS\",\"Windows 10\"}],\"ProductName\":\"Test Name\",\"InitialUploadFileSize\": 50}");
    

    code block used: 

    HttpClient httpClient = HttpClientBuilder.create().build();
    		String sysdevEndPoint = "https://devicesigningservice.cloudapp.net/api/signing/devices/";
    		HttpPost request = new HttpPost(sysdevEndPoint);
    		StringEntity params =new StringEntity("{\"TestHarnessType\": \"HLK\",\"OSSelections\": [{\"OS\",\"Windows 7\"},{\"OS\",\"Windows 8\"},{\"OS\",\"Windows 8.1\"},{\"OS\",\"Windows 10\"}],\"ProductName\":\"Test Name\",\"InitialUploadFileSize\": 50}");
    		request.setHeader("Content-Type", "application/json");
    		System.out.println("Sending token ---->"+ access_token);
    		request.setHeader("Authorization", "Bearer "+ access_token);
    //		Log.i("DEBUG", "HEADERS: " + request.getFirstHeader("Authorization: Bearer"));
    		request.setEntity(params);
    		HttpResponse response = httpClient.execute(request);
    		
    		System.out.println("-------------------------------------------------------------------------------------------------------");
    		System.out.println(response);
    		System.out.println("-------------------------------------------------------------------------------------------------------");
    		Header[] headers = response.getAllHeaders();
    		for (Header header : headers) {
    			System.out.println("Key : " + header.getName() 
    			+ " ,Value : " + header.getValue());
    		}

    Any suggestion is highly appreciated

    Wednesday, July 6, 2016 2:18 PM