2016-08-05 93 views
1

我在发送GET请求到Java SAML url(https://en.wikipedia.org/wiki/SAML_2.0ApacheHttpClient4时出现问题。我从前一个请求中获得的位置标题中获取url,返回302.然后,我在url上执行GET,格式为https://some.domain/?SAMLRequest=...&RelayState=...。 Jersey以某种方式卡住了它,并且从未发送实际的请求(我已经检查了两个Charles并启用了日志过滤器,但GET从未发生过,它甚至不尝试)。它被贴在下面一行:泽西岛客户端卡在SAML GET请求

PoolingClientConnectionManager - Connection request: [route: {tls}->http://127.0.0.1:8888->https://some.domain][total kept alive: 3; route allocated: 2 of 2; total allocated: 7 of 20]

回答

0

这是一个艰难的,但是我终于设法解决它通过添加ClientFilter于只做以下客户:

/** 
* This class is only used to solve cases where a Client gets stuck in a redirect process. 
*/ 
public class MyClientFilter extends ClientFilter { 

    @Override 
    public ClientResponse handle(ClientRequest clientRequest) throws ClientHandlerException { 
     return getNext().handle(clientRequest); 
    } 
} 

不知何故,它设法强制客户端继续遵循重定向。