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


当前回答

简而言之,请。: -)

身份验证=登录名+密码(你是谁) 授权=权限(你被允许做的事情)

简短的“auth”最有可能指的是第一个或两者。

其他回答

在用户环境中:

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

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

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

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

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

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

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

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

  Authentication Authorization
What does it do? Verifies credentials Grants or denies permissions
How does it work? Through passwords, biometrics, one-time pins, or apps Through settings maintained by security teams
Is it visible to the user? Yes No
It is changeable by the user? Partially No
How does data move? Through ID tokens Through access tokens

更详细的答案请参考:https://www.okta.com/identity-101/authentication-vs-authorization/

正如身份验证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上的身份验证与授权

身份验证是确定某人确实是他们所声称的那个人的过程。 授权是指决定谁可以做什么的规则。例如,亚当可能被授权创建和删除数据库, 而Usama只被授权阅读。

这两个概念是完全正交和独立的,但它们都是安全设计的核心,如果其中任何一个概念都不正确,就会导致妥协。

就web应用程序而言,简单地说,身份验证是指你检查登录凭证,看看你是否识别出用户已登录,而授权是指你在访问控制中查看是否允许用户查看、编辑、删除或创建内容。

简而言之,请。: -)

身份验证=登录名+密码(你是谁) 授权=权限(你被允许做的事情)

简短的“auth”最有可能指的是第一个或两者。