Auth
After today, you can tell authentication from authorization, explain how a token keeps you signed in, and say why every path to a document needs its own check.
Dip your toes 1 min
Auth covers two separate checks that happen every time you open something. Open a Google Doc someone shared with you. First, Google checks who you are, which is why you sign in. Then it checks what you may do with this particular doc: read it, comment on it, or edit it. Those levels are called roles, and the same person can be an editor on one doc and locked out of the next. For designers, every role is its own version of the screen, and each failed check needs its own message. A sign-in page and a “request access” page solve different problems. A search result or an email preview needs the same check as the doc.
The full lesson 10 min
Why this exists
Open a Google Doc that someone shared with you. Sometimes you can type in it, sometimes you can only leave comments, and sometimes you can only read. And sometimes you get a page that says you need access, with a button to ask the owner. The doc is the same file in every case. What changed is who you are and what you’ve been allowed to do.
Every request that reaches Google’s servers has to answer those two questions before anything else happens. Get them wrong in one direction, and people can’t do their work. Get them wrong in the other, and a private document reaches someone who should never have seen it. Mistakes in the second direction are the kind that make the news, and they can’t be undone once the document has been seen.
Engineers shorten both questions to one word, “auth,” and that causes real confusion. When someone says “it’s an auth problem,” they could mean either question. The two have different fixes, different error screens, and often different owners. Some engineers write them as “authn” and “authz” to keep them apart. Separating them is the first step to designing either one well.
What it is
The first question is authentication: proving who someone is. You do it when you sign in, with a password, a code sent to your phone, or a passkey. A passkey is a sign-in method that uses your device’s lock, like a fingerprint, instead of a password. Authentication ends with the server confident it knows which account is making the request. It says nothing yet about what that account may do.
The second question is authorization: checking what an identified person is allowed to do with a specific thing. Google knows you’re signed in. Now it asks whether this account may edit this particular document. The answer depends on the document as much as the person. You might be an editor on one doc and have no access at all to the next one.
The order matters. Authorization can’t start until authentication has finished, because there’s no one to check permissions for yet. Each gate has its own failure screen: the first asks you to sign in, and the second says you don’t have access. In the status codes from Day 9, those are usually 401 and 403. The 401’s official name is “Unauthorized,” even though it means unauthenticated, which shows how often the two get mixed up.
Signing in on every click would be unbearable, so the server remembers you. After you sign in, it starts a session, the stretch of time you stay signed in. It hands your browser a token, a long string of characters that stands for your signed-in account, or a session ID that points to it. The browser usually keeps it in a cookie, a small piece of data a website stores in your browser and gets back with each request. From then on, the token rides along on every request.
A hotel key card is a good model. The front desk checks your ID once, which is authentication, and hands you a card, which is the token. The card opens your room and the gym but not other guests’ rooms, which is authorization. And it stops working at checkout, which is the end of the session. Sessions end on a timer, when you sign out, or when the server revokes them, for example after a password change.
Because the token stands for you, whoever holds it is you, as far as the server can tell. That’s why tokens expire, why they’re meant to travel only over encrypted connections, and why “sign out of all devices” exists. It also explains why session length differs so much between products. A banking app may sign you out after a few idle minutes, while a document editor keeps you signed in for weeks. The cost of a stolen session is different, so the trade between safety and convenience lands in a different place.
Many products don’t run the first gate themselves. A “Sign in with Google” button on another site hands authentication to Google: Google checks who you are and vouches for you to that site. The site still runs the second gate, because only it knows what you’re allowed to do inside it. Authentication can be borrowed from someone else, but authorization always stays home.
The last piece is the role, a named bundle of permissions that a person holds for a specific thing. Google Docs offers three when you share: viewer, commenter, and editor. Each document also has an owner, who can do everything, including deciding who else gets in. Roles exist because checking each permission one by one, for every person on every document, would be impossible to manage. A role packs those decisions into one word.
Google Docs also lets an owner give a role to anyone who has the link, through its general access setting. Then the link itself works like a key. Forwarding it hands that role to whoever receives it, which is why the sharing dialog shows the setting so plainly. It’s an authorization rule tied to a link instead of a person.
How it shows up in your work
A shared doc is really three or four screens, one per role, and each needs to make sense on its own. Google’s sharing settings list what each role can do. A viewer can read, a commenter can read and comment, and an editor can also edit and share. Editors share by default, but the owner can turn that off.
Every new feature adds a row or a column to that grid. Say your team adds a way to summarize a doc’s comments. Should a viewer see the summary, or only people who can comment? That’s an authorization rule, and if the spec doesn’t decide it, an engineer will, quietly, in code. Add a short permissions table to any spec that shows or changes data.
Session endings need designing too. A session can end while someone is in the middle of a task, on a timer or because they signed out on another device. The next request carries a token the server no longer accepts. Design that moment: what happens to the comment they were typing, and where do they land after signing back in? A good answer keeps their work and returns them to the same place.
Error screens should keep the two gates apart. A sign-in page asks the person to prove who they are. An access page tells them who can let them in. It also must not reveal what’s inside, since the person asking may not be allowed to know. Writing one generic “something went wrong” for both throws away the most useful thing the server knows.
The one thing people get wrong
A team ships a new search box. Every document is locked down by its sharing settings, so search seems safe. Then a viewer types a word and sees the title of a doc they were never invited to. Search results, link previews, notifications, and exports all show pieces of a document, and each one is its own path to the data. Designers add paths like these all the time, often without thinking of them as access.
Some paths carry content out of the product entirely. An email that quotes a new comment takes that comment to whoever the email reaches. If someone loses access tomorrow, last week’s emails still sit in their inbox. A downloaded export works the same way, because a copy on someone’s laptop no longer checks anyone’s role.
Hiding a button is good design but not a lock, as Day 1 showed, because people control what their own device sends.
The real check lives on the server, and it runs on every request, whatever sent it. The server looks up the person behind the token, finds their role on that document, and refuses anything the role doesn’t allow. Engineers often write that check once and reuse it for every endpoint that touches documents, so a new feature can’t forget it. When you design a new place where content appears, ask whether it runs the same authorization check as the document itself.
Missing server checks are among the most common security flaws on the web. The Open Worldwide Application Security Project (OWASP), a nonprofit that tracks web security risks, ranks broken access control first in its 2025 list. Broken access control means users can act outside their permissions. It’s often a missing authorization check behind an interface that looked locked. There’s more here about other kinds of attacks; Day 21 covers them.
Ask an engineer this
“Besides the doc itself, where does its content show up (search, previews, emails, exports), and does each run the same access check?”
Bring this up when a feature adds a new place where a document’s content appears, ideally while the spec is still open. The engineer should point to one place on the server where the rule is checked, often shared by every endpoint that touches the data. Ask, too, whether automated tests try each path as each role and expect a refusal. If the reply is vague, or one path has its own separate check, that path is where a leak would start. Either way, you’ve made authorization part of the design conversation instead of an afterthought.
Terms from today
- Authentication
- Checking who someone is, usually with a password, a code, or a passkey.
- Authorization
- Checking what an identified person is allowed to do with a specific thing, like one document.
- Session
- The stretch of time a person stays signed in, tracked by the server so they don’t have to sign in again on every request.
- Token
- A string of characters issued at sign-in that the app sends with each later request to prove who it’s acting for.
- Role
- A named bundle of permissions, like viewer or editor, that a person holds for a specific thing.