xmlrpc 用户凭证不是真实逻辑

发布于 2024-10-01 01:27:14 字数 396 浏览 2 评论 0原文

好的,我正在按照本教程进行基本的 PHP Web 服务服务器/客户端设置:

http: //www.java-samples.com/showtutorial.php?tutorialid=1186

现在我想添加用户身份验证并使功能正常工作,但想知道用户是否未进行身份验证我该如何返回 http 状态 401 未经授权?

我没有使用 HTTP 进行身份验证(使用用户、密码和盐对数据库进行身份验证),但具有用于此目的的功能。我可以设置什么来通知 http 用户未获得授权吗?或者我以错误的方式看待这个问题?

感谢您提供任何有用的提示

Ok I'm following this tutorial for a basic PHP webservice server/client setup:

http://www.java-samples.com/showtutorial.php?tutorialid=1186

Now I'm wanting to add a user authentication and have the functionality working but wanted to know if the user doesn't authenticate how can I return an http Status 401 Unauthorized?

I'm not using HTTP to authenticate (using user,pass and salt against a database) but have the functionality working for this. Is there something I can set to notify http that the user is not authorised? Or am I looking at this the wrong way?

Thanks for any helpful tips

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

z祗昰~ 2024-10-08 01:27:14

401 专门设计用于表示使用 HTTP 身份验证。 401 Unauthorized 响应必须包含 WWW-Authenticate,但反之则不然。

401 is specifically designed to signal the use of HTTP authentication. 401 Unauthorized responses MUST include a WWW-Authenticate, but the opposite is not true.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文