如何执行非抢占式身份验证

问题描述

我有一段看起来很标准的Java代码,它将身份验证附加到请求上,如下所示:

import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;

...

HttpAuthenticationFeature feature = HttpAuthenticationFeature.basicBuilder().nonPreemptive()
                    .credentials(user,pwd).build();

我宁愿只使用Postman发出原始请求(如果可能的话),而不是构建Java客户端jar。我尝试使用基本的Authorization标头标签执行此操作,但是服务器仍指示我的凭据错误:

<html>

<body>
    <h1>401 Unauthorized</h1>
    You need a valid user and password to access this content.
</body>

</html>

我是否需要做任何特别的事情来处理此身份验证方法的非抢占部分?在这种情况下可以使用Postman还是我需要jar客户端?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)