Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
MKAPOOR1596038160
Contributor II
Contributor II

Proxy error with tRestClient

I am using tRESTClient to access data from internet using our firewall proxy authentication with combination of 2 tRESTClient componets, one for getting token and next for fetching data in sequence as shown below. The first stage of authentication works fine and i am able to get the token using http proxy authentication but in next stage while i am fetching data, it gives an error as below. Please help

Starting job testing2_with_proxy at 09:21 14/09/2021.

[statistics] connecting to socket on port 3945

[statistics] connected

200|<?xml version="1.0" encoding="UTF-8"?>

<root><token_type>Bearer</token_type><expires_in>3599</expires_in><ext_expires_in>3599</ext_expires_in><expires_on>1631595088</expires_on><not_before>1631591188</not_before><resource>xxxxxxxxxxxxxxxxxxxx</resource><access_token>xxxxxxxxxxxxx</access_token></root>|

xxxxxxxx|Bearer

Sep 14, 2021 9:21:29 AM org.apache.cxf.interceptor.LoggingOutInterceptor

INFO: Outbound Message

---------------------------

ID: 1

Address: https://management.azure.com/subscriptions/xxxxxxxxxxxxxxx/resourcegroups?api-version=2021-07-01

Http-Method: GET

Content-Type: application/xml

Headers: {Accept=[application/xml], Authorization=[Basic xxxxxxxxxxxxxxxxxxxxxx], Content-type=[application/xml], Proxy-Authorization=[Basic xxxxxxxxxxxxxxxxxxxxxxxxxx]}

--------------------------------------

Sep 14, 2021 9:21:30 AM org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream authorizationRetransmit

WARNING: WWW-Authenticate response header is not set

Sep 14, 2021 9:21:30 AM org.apache.cxf.interceptor.LoggingInInterceptor

INFO: Inbound Message

----------------------------

ID: 1

Response-Code: 407

Encoding: UTF-8

Content-Type: text/html; charset=utf-8

Headers: {Cache-Control=[no-cache], connection=[close], Content-Length=[849], content-type=[text/html; charset=utf-8], Pragma=[no-cache], Proxy-Authenticate=[BASIC realm="Gateway_Authentication"], Proxy-Connection=[close], X-XSS-Protection=[1]}

--------------------------------------

Exception in component tRESTClient_2 (testing2_with_proxy)

javax.ws.rs.ClientErrorException: HTTP 407 Proxy Authentication Required

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at org.apache.cxf.jaxrs.utils.ExceptionUtils.toWebApplicationException(ExceptionUtils.java:179)

at org.apache.cxf.jaxrs.client.AbstractClient.convertToWebApplicationException(AbstractClient.java:538)

at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:940)

at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:901)

at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:461)

at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:641)

at test.testing2_with_proxy_0_1.testing2_with_proxy.tRESTClient_1Process(testing2_with_proxy.java:2746)

at test.testing2_with_proxy_0_1.testing2_with_proxy.tSetGlobalVar_1Process(testing2_with_proxy.java:445)

at test.testing2_with_proxy_0_1.testing2_with_proxy.runJobInTOS(testing2_with_proxy.java:3400)

at test.testing2_with_proxy_0_1.testing2_with_proxy.main(testing2_with_proxy.java:3249)

[statistics] disconnected

Job testing2_with_proxy ended at 09:21 14/09/2021. [Exit code = 1]

0695b00000Ie9wGAAR.png

Labels (2)
1 Reply
Anonymous
Not applicable

Hi

Can you share a screenshot to show the basic setting of tRestClient_2, the second tRestClient will use the token returned by the first tRestClient?

 

Regards

Shong