在web应用程序中有什么不同?我经常看到缩写“auth”。它是代表认证还是授权?或者两者都有?
当前回答
认证是识别有效用户的过程。
授权是验证用户访问级别的过程。
应用程序示例 用户A、用户B均为库存应用的认证用户。 两个用户都可以进入股票,但B对发行项目有更多的授权权力。
其他回答
补充@Kerrek的答案;
身份验证为通用形式(所有员工都可以登录机器)
授权是专用形式(但管理员只能在机器上安装/卸载应用程序)
身份验证是验证您的登录用户名和密码的过程。
授权是验证您是否可以访问某些内容的过程。
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/
我发现这篇文章中的类比对我很有帮助。
Consider a person walking up to a locked door to provide care to a pet while the family is away on vacation. That person needs: Authentication is in the form of a key. The lock on the door only grants access to someone with the correct key in much the same way that a system only grants access to users who have the correct credentials. Authorization is in the form of permissions. Once inside, the person has the authorization to access the kitchen and open the cupboard that holds the pet food. The person may not have permission to go into the bedroom for a quick nap.
因此,简而言之,认证是关于用户身份的,而授权是关于用户权限的。
混淆是可以理解的,因为这两个词听起来很相似,而且概念经常密切相关并一起使用。此外,如前所述,常用的缩写Auth也没有帮助。
其他人已经很好地描述了身份验证和授权的含义。这里有一个简单的规则来帮助区分这两者:
身份验证验证您的身份(或真实性,如果您喜欢) 授权验证您的权限,即您访问和可能更改某些内容的权利。
推荐文章
- 检查SQL Server登录是否已经存在
- 阻止人们入侵基于php的Flash游戏高分表的最佳方法是什么
- SQL Server 2008不能用新创建的用户登录
- Passport.js -错误:序列化用户到会话失败
- 令牌身份验证vs. cookie
- JWT vs cookie用于基于令牌的身份验证
- 在php中生成一个随机密码
- java.util.Random和java.security. securerrandom的区别
- Docker和安全密码
- 准备好的语句如何防止SQL注入攻击?
- 为什么人们会写“throw 1;<不要邪恶>”和“for(;;);”在json响应前?
- 非加密用途的最快哈希?
- 为跨源请求设置cookie
- SHA512 vs. Blowfish和Bcrypt
- REST身份验证方案的安全性