所有主要的网络应用程序(谷歌、Facebook 等)在身份验证失败的情况下返回页面状态 200 ok
,即错误的登录名/密码对。
虽然通过 definition ,如果未找到具有请求 URI 的资源 - 返回状态 404 Not found
。
维基百科说:
[404 Not Found] Used when the requested resource is not found, whether it doesn't exist or if there was a 401 or 403 that, for security reasons, the service wants to mask
login 的情况有何不同?
最佳答案
服务器代码 200 表示您收到响应。是否是您的凭据错误。如果您的请求尚未处理,则服务器返回不同的错误代码。但是对于你的情况,
您的登录请求已被处理,与数据库的连接已建立,您从中得到了错误的凭据消息。所以代码 200 是你成功处理的请求。
关于authentication - 为什么error login和password server return status 200 ok,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47427371/