我们应该说“权限”和“登录”,而不是“身份验证”
Instead of “auth”, we should say “permissions” and “login”

原始链接: https://ntietz.com/blog/lets-say-instead-of-auth/

简单来说,许多计算机系统采用某种形式的身份管理,通俗地称为“身份验证”。 然而,该术语可以涵盖身份验证和授权过程。 身份验证确定用户身份,而授权则根据这些已识别的用户授予访问权限。 使用一致且清晰的标签(例如“验证者”和“授权者”)将有助于避免对其功能的混淆。 然而,这些术语并没有被广泛采用,因为它们不如术语“auth”那么吸引人且更难记住。 相反,选择“登录”进行身份验证(验证用户凭据的过程),选择“权限”进行授权(授予适当的访问级别)。 这些术语非常清晰,无需大量解释,使软件工程社区内外的沟通变得更加容易。 通过承认身份验证和授权之间的差异,我们可以促进更好的抽象并提高整体设计质量。

本文讨论了加密系统背景下“授权”和“身份验证”概念的重要性和细微差别。 尽管每个人都了解权威和真实性的基本定义,但将这些概念专门应用于加密货币需要精确性。 由于这些术语的历史意义和相互关联的性质,文本反对更改这些术语。 它强调了围绕信任和验证的挑战和困惑,并将它们与英语语言的矛盾和其他具有挑战性的方面进行比较。 文本最后呼吁在网络安全领域进行清晰的沟通。 本质上,“授权”决定允许用户或实体执行什么操作,而“身份验证”则验证寻求访问的用户或实体的身份。 尽管它们的功能不同,但它们仍然紧密相连。 文本建议谨慎对待过度简化它们的区别或试图替换它们的原始单词。 相反,它鼓励专注于准确理解和掌握每个概念。 此外,文本承认“登录”已经不仅仅是记录访问,现在充当身份验证和授权过程的简写。 虽然其起源在于运输日志和速度测量,但如今的登录已成为访问控制机制的组成部分。 该文本还解决了常见的误解,例如“未经身份验证”和“未经授权”状态之间的关系。 它解释了这两个条件可以同时发生,但强调了准确标记对于有效错误报告的重要性。 此外,文本承认计算中其他领域的复杂性,包括时间管理、地理定位和加密算法,这些领域同样对开发人员和研究人员提出了挑战。 总体而言,我们传达的信息仍然是:力求清晰、准确和深入理解,特别是在网络安全的关键领域。
相关文章

原文

Most computer systems we interact with have an auth system of some kind. The problem is, that sentence is at best unclear and at worst nonsense. "Auth" can mean at least two things: authentication or authorization. Which do we mean for an "auth system"? It's never perfectly clear and, unfortunately, we often mean both.

This is a widespread problem, and it's well known. One common solution, using the terms "authn" and "authz", doesn't solve the problem. And this isn't just confusing, it leads to bad abstractions and general failures!

Comic about an ambiguity in the term "log in."

Calling things just "auth" is common. It's used in library names (django-allauth is for authentication, and go-auth is also authentication), package names (django.contrib.auth, which does both authentication and authorization), and even company names.

Since "auth" can mean two things, this naming leads to ambiguities. When you see a new auth library or product, you don't know right away what it's able to handle. And when you talk about it, it's also not clear what you're referring to.

The canonical solution is to call these "authn" and "authz", the n and z evoking the longer words. Thes are just not satisfactory, though. They're clunky and hard to understand: they're not universal enough to be able to skip explanation; they're easy to mishear and are close together; and what verb forms would we even use?

It's not just about bad communication, though. This terminology implies that the two concepts, authentication and authorization, are more closely related than they are. It encourages bad abstractions to combine them, because we have one word, so we feel like they should belong together. But they are two pretty fundamentally distinct problems: checking who you are, and specifying access rights.

There are some links between auth and auth, because what you can do is tied to who you are. But they're also very different, and deserve to be treated that way. At the very least, recognizing that they're different leads to recognition that solving one does not solve the other.

We should always use the most clear terms we have. Sometimes there's not a great option, but here, we have wonderfully clear terms. Those are "login" for authentication and "permissions" for authorization. Both are terms that will make sense with little explanation (in contrast to "authn" and "authz", which are confusing on first encounter) since almost everyone has logged into a system and has run into permissions issues.

There are two ways to use "login" here: the noun and the verb form. The noun form is "login", which refers to the information you enter to gain access to the system. And the verb form is "log in", which refers to the action of entering your login to use the system.

"Permissions" is just the noun form. To use a verb, you would use "check permissions." While this is long, it's also just... fine? It hasn't been an issue in my experience.

Both of these are abundantly clear even to our peers in disciplines outside software engineering. This to me makes it worth using them from a clarity perspective alone. But then we have the big benefit to abstractions, as well.

When we call both by the same word, there's often an urge to combine them into a single module just by dint of the terminology. This isn't necessarily wrong—there is certainly some merit to put them together, since permissions typically require a login. But it's not necessary, either, and our designs will be stronger if we don't make that assumption and instead make a reasoned choice.


If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts and support my work, subscribe to the newsletter. There is also an RSS feed.

联系我们 contact @ memedata.com