我需要从中获取用户名和密码HttpServletRequest
来处理基本身份验证。我拥有的是CXF
端点和基本的身份验证拦截器。HttpServletRequest
我得到这样的:
public void handleMessage(Message message)
throws Fault {
HttpServletRequest request = (HttpServletRequest) message.get(AbstractHTTPDestination.HTTP_REQUEST);
}
当我尝试调试代码时,我看到:
request.getAuthType() is null
request.getRemoteUser() is null
我通过 Soap UI 的请求发送的用户名和密码。所以问题是我如何从请求中获取用户名和密码?
编辑
标题如下所示:
POST http://localhost:8011/GradIrelandUserRegistration HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
Authorization: Basic UGF1bGl1czpQYXVsaXVzMTIz
Content-Length: 3170
Host: localhost:8011
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
他们说授权是基本的,但是为什么调用request.getAuthType()
返回 null 呢?