cancel
Showing results for 
Search instead for 
Did you mean: 

Rest API Call - 407 Authentication required

SHAHRULRIZALSAI
Level 3
Hi Experts,

I had invoked restful API hosting in azure from Object and received below error.

Internal : Unexpected error Error during Web API HTTP Request
HTTP Status Code: 407
HTTP Response Content: <HTML><HEAD>
<TITLE>Access Denied</TITLE>

This is because, form our network it has to go through proxy authentication to access external URI. 
If i am browse to any external website from resource PC, then i am able to proceed run the object and get the response content. otherwise it will return 407 error.

This issue because of calling an external URI require a proxy authentication. How to call a rest API with enter the proxy authentication?

------------------------------
SHAHRULRIZAL SAID
------------------------------
1 BEST ANSWER

Helpful Answers

ewilson
Staff
Staff
The WebAPI feature of Blue Prism does not support proxy authentication. If the is a requirement there is a REST web service VBO available on the Digital Exchange that I believe supports this. If not, the alternative would be to use a code stage and invoke the .Net HttpWebClient object directly. With that, you can definitely set up proxy authentication.

------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------

View answer in original post

4 REPLIES 4

ewilson
Staff
Staff
The WebAPI feature of Blue Prism does not support proxy authentication. If the is a requirement there is a REST web service VBO available on the Digital Exchange that I believe supports this. If not, the alternative would be to use a code stage and invoke the .Net HttpWebClient object directly. With that, you can definitely set up proxy authentication.

------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------

Hi Eric,

Thank you very much on your response.
Will do it via code stage.

------------------------------
SHAHRULRIZAL SAID
------------------------------

Hi Shah,

Were you able to handle the proxy authentication via code stage?

------------------------------
Aravinda Misra
------------------------------

Hi Aravindra,
Yes i had use it in code stage.
I am using below in code stage

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.google.com");

IWebProxy proxy = request.Proxy;
string URI = string.Empty;
if (proxy != null)
{
URI = proxy.GetProxy(request.RequestUri).AbsoluteUri;

}

WebProxy myProxy = new WebProxy();
Uri newUri = new Uri(URI);
myProxy.Address = newUri;
myProxy.Credentials = new NetworkCredential(UserName, Password,"MyDomain");
request.Proxy = myProxy;
var client = new HttpClient();
var uri = "http://www.google.com";
var response = client.GetAsync(uri);

------------------------------
SHAHRULRIZAL SAID
------------------------------