[英]Java RESTful client [RESTEasy or Apache HttpClient] - NTLM on the other side
How to call RESTful webservice (from Java - using RESTEasy/Apache HttpClient) which requires NTLM authentication within Active Directory, without necessity of entering user data again (domain, username, password) - user is already authenticated in Windows? 如何调用需要在Active Directory中进行NTLM身份验证的RESTful Web服务(从Java-使用RESTEasy / Apache HttpClient),而无需再次输入用户数据(域,用户名,密码)-用户已经在Windows中进行了身份验证?
GET http://some_server/restapi/books
This works perfectly from web browsers or even java.net.URL library - user is not getting prompted for credentials, no 401 authentication errors - simply 200 OK
is returned. 这在Web浏览器甚至java.net.URL库中都可以完美运行-不会提示用户输入凭据,没有401身份验证错误-仅返回
200 OK
。
How to do the same using Apache HttpClient or RESTEasy client? 如何使用Apache HttpClient或RESTEasy客户端执行相同操作?
You can do that with this structure; 您可以使用此结构来完成;
You need to save access token on client side like local storage. 您需要像本地存储一样在客户端保存访问令牌。 Same as if you are useing http client, you can give that access_token in header.
与使用http客户端一样,您可以在标头中提供该access_token。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.