在web应用程序中有什么不同?我经常看到缩写“auth”。它是代表认证还是授权?或者两者都有?
当前回答
我发现这篇文章中的类比对我很有帮助。
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.
因此,简而言之,认证是关于用户身份的,而授权是关于用户权限的。
其他回答
身份验证是验证所宣布的身份的过程。
例如,用户名/密码
通常接下来是授权,也就是批准你可以这样做或那样做。
如权限
我试图用最简单的语言来解释这一点
1)身份验证意味着“你是你所说的那个人吗?”
2)授权意味着“你能做你想做的事吗?”
这在下图中也有描述。
我试图用最好的术语来解释它,并创造了一个相同的图像。
我发现这篇文章中的类比对我很有帮助。
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”最有可能指的是第一个或两者。
身份验证是通过获取某种凭据(例如用户名密码组合)来验证用户身份的过程,并使用这些凭据来验证用户的身份。
授权是通过检查用户是否具有系统访问权限,从而允许经过认证的用户访问其资源的过程。您可以通过向已验证的用户授予或拒绝特定的权限来控制访问权限。因此,如果身份验证成功,则启动授权过程。认证过程始终进行到授权过程。
用于授权的JWT: JWT是一种基于JSON的安全令牌格式,它基本上是一个base64 url编码的字符串,用于传输 保护两个应用程序之间的内容。它们用于保护Web api中的请求数据。这些都包含在授权HTTP报头中,作为承载身份验证方案的一部分。
OAuth代表授权:OAuth不是API或服务:它是授权的开放标准,任何人都可以实现它。有了OAuth,你可以用你的谷歌、Facebook、Twitter或微软账户登录第三方网站,而不需要提供密码。这样你就可以避免在互联网上使用的每个web应用程序上创建帐户和记住密码。
推荐文章
- JavaScript:客户端验证与服务器端验证
- ASP。NET身份的默认密码散列器-它是如何工作的,它是安全的?
- 人们如何在Go中管理身份验证?
- 主体、使用者和主体之间的意义和区别是什么?
- 检查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响应前?