在web应用程序中有什么不同?我经常看到缩写“auth”。它是代表认证还是授权?或者两者都有?


当前回答

正如身份验证vs授权所言:

Authentication is the mechanism whereby systems may securely identify their users. Authentication systems provide an answers to the questions: Who is the user? Is the user really who he/she represents himself to be? Authorization, by contrast, is the mechanism by which a system determines what level of access a particular authenticated user should have to secured resources controlled by the system. For example, a database management system might be designed so as to provide certain specified individuals with the ability to retrieve information from a database but not the ability to change data stored in the datbase, while giving other individuals the ability to change data. Authorization systems provide answers to the questions: Is user X authorized to access resource R? Is user X authorized to perform operation P? Is user X authorized to perform operation P on resource R?

参见:

Wikipedia上的身份验证与授权

其他回答

在用户环境中:

身份验证=验证用户的身份(从技术上讲,你可以验证很多不同的东西,比如密码、税务信息、社会安全信息、驾照、指纹或其他生物识别信息……但通常用户名/密码就足够了)

授权=允许用户做某事(你可以设置角色['管理员','卖家','买家'…权限['访问控制中心','删除产品'…并将这些角色赋予用户,然后验证用户有一个允许他执行操作的角色)

权限与CRUD操作有直接关系,因此如果构建一个UI,您可以将对象列为行,并在任意给定角色的对象权限的创建、读取、更新和删除的4列中设置复选框。

就像在我上面的例子中,“访问控制中心”是对控制中心对象的完整的创建、读取、更新和删除访问,而“删除产品”是对产品对象的删除访问。

注意:HTTP授权头用于访问资源的权限,但实际上用于所有资源访问的身份验证。

在我的头脑中和代码中更容易想到验证和权限,因为这两个词

听起来不一样 不要有相同的缩写 授权的实际实现通常涉及角色和权限的实现

身份验证是验证,授权是检查权限。Auth可以是任何一种意思,但更常用的是“用户认证”,即。“用户身份验证”。很多时候没有显式的授权实现(角色和权限),只是使用身份验证来提供执行每个可用操作的授权。这就是Auth。

补充@Kerrek的答案;

身份验证为通用形式(所有员工都可以登录机器)

授权是专用形式(但管理员只能在机器上安装/卸载应用程序)

我试图用最简单的语言来解释这一点

1)身份验证意味着“你是你所说的那个人吗?”

2)授权意味着“你能做你想做的事吗?”

这在下图中也有描述。

我试图用最好的术语来解释它,并创造了一个相同的图像。

身份验证是验证您的登录用户名和密码的过程。

授权是验证您是否可以访问某些内容的过程。

Authentication是一个验证的过程:

系统中的用户身份(用户名、登录名、电话号码、电子邮件……),通过提供证明(密钥、生物识别、短信……)作为扩展的多因素身份验证。 使用数字签名检查电子邮件[关于] 校验和

授权是身份验证之后的下一步。它是关于资源的权限/角色/特权。OAuth(开放授权)是授权的一个例子