Collecting only what you need
Every value a service collects has to be stored, protected and eventually deleted, so the first question is what each value is for. This lesson follows the printer as it decides what to ask about Ava when she signs in: starting from the decision the data supports, asking for a fact instead of a whole record, keeping purposes apart, and checking that the smaller design still works.
Start with the decision the data supports
Ava has been putting together a photo book at the printer. She signs in with her photo account, and she wants the printer to remember her: the next time she comes back, the half-finished book and her other saved projects should be waiting. The printer's sign-in request asks the photo service for openid profile email, and on her first visit its welcome form also asks for her birth date, her home address and her employer.
Ask what each of those values is for, and most have no answer. The printer is about to make one decision: is this the same person who saved these projects last week? Her birth date does not help with that, and neither does her employer. Her home address is not even where a particular book has to go. Each value would still have to be stored, protected, kept out of logs, shown to support staff only when they need it, and eventually deleted. Collecting them adds work and exposure without helping the task.
Data minimization means asking for information that is adequate and relevant to a stated purpose, and limiting what is collected and used beyond it. The useful starting point is not a list of fields but the decisions a service actually makes. Recognizing a returning account is one. Contacting the account holder, deciding whether someone is eligible for something, and recording who made an important change are others. They need different facts, and different levels of trust in those facts.
For recognizing a returning account, OpenID ConnectAn identity layer on top of OAuth 2.0 that lets an application sign people in with an account at another service. It adds the ID token, standard claims, and discovery to the OAuth exchange. already supplies the fact. The issuerThe party that creates and signs a token, assertion, or certificate, named in a token's iss claim. A recipient must check that the issuer is exactly the one it expected and trusts. and the subject identifier, taken together, name one account at one provider and are never reassigned to another person. Claim stability and privacy explained why the printer keys its accounts on that pair rather than on an email address. For this decision, everything else in the sign-in is optional.
Ask for a fact instead of a whole record
The printer can test that by asking for less. Ava signs in once with openid profile email and once with openid alone. These are the two ID tokenIn OpenID Connect, a signed JWT from the provider, addressed to one client, saying which account authenticated, when, and in answer to which request. It reports a sign-in and is not used to call APIs. payloads, decoded:
// scope=openid profile email
{
"iss": "https://auth.photos.example",
"sub": "user-3117",
"aud": "photo-printer",
"iat": 1790845200,
"exp": 1790845500,
"name": "Ava",
"email": "[email protected]",
"email_verified": true
}
// scope=openid
{
"iss": "https://auth.photos.example",
"sub": "user-3117",
"aud": "photo-printer",
"iat": 1790845800,
"exp": 1790846100
}All people, hosts and identifiers in these examples are fictional.
This provider places the profile and email claims straight into the ID tokenA piece of data issued by a trusted service that a client presents as a credential, for example to call an API or to report a sign-in. Some tokens carry readable claims; others are random strings that only the issuer can interpret.. OpenID Connect Core leaves that to the provider: when the sign-in also issues an access tokenA token that a client presents to an API to use access it has been granted, usually limited in what it allows and how long it lasts. It authorizes API calls; it does not tell the client who signed in., as here, the claims that profile and email request are returned from the UserInfo endpointAn OpenID Provider endpoint that returns claims about the signed-in person to a client presenting an access token. Its sub must match the ID token's before the client uses anything it returns., and appear in the ID token only if the provider chooses to put them there or the client asks for them individually. Wherever they arrive, the release is the same.
The second token carries no name and no email, but iss and sub are the same, so the printer finds the same account and opens the same saved projects. The scope is how the printer says what it wants released. Scopes and the claims parameter showed how profile and email expand into claims, and how a client can ask for individual claims instead of whole groups.
scope=openid profile email
- iss and sub
- auth.photos.example, user-3117
- name
- Ava
- [email protected]
- email_verified
- true
- Saved projects
- Found
Three more values to store, protect and delete
scope=openid
- iss and sub
- auth.photos.example, user-3117
- name
- Not released
- Not released
- email_verified
- Not released
- Saved projects
- Found
The same account, nothing extra
For this decision, everything else in the sign-in is optional.
The sign-in is only one path the data can take, though. With the access token from the openid sign-in, the photo service's UserInfo endpoint should agree:
GET /userinfo HTTP/1.1
Host: auth.photos.example
Authorization: Bearer demo-openid-only-token
HTTP/1.1 200 OK
Content-Type: application/json
{
"sub": "user-3117"
}If UserInfo returned the full profile anyway, or the printer fetched it from a separate profile APIAn application programming interface: a defined way for software to interact with a service. A web API offers endpoints where other programs send HTTP requests. and stored it, the narrow sign-in would have achieved nothing. The same is true of what happens after the data arrives: what the printer stores, what its own APIs return, and what it writes to logs. The printer stores only the fields on a short, agreed list, and it keeps personal values out of URLs and routine diagnostics, where they spread into systems that nobody reviews for privacy.
Sometimes a decision needs more than an identifier, and then the same idea points at a fact rather than a whole record. Say the printer offers a student discount. The fact it needs is "currently enrolled", from a source it trusts to know. A statement from the student's college saying exactly that serves the purpose. The student's birth date, home address and full enrollment record add nothing to it. Minimization does not mean accepting weaker information, either. A checkbox where the customer ticks "I am a student" is smaller still, and it does not support the decision at all. Whether a narrower statement is enough depends on who issued it and what it actually says.
Separate purposes and access
A week later, a product manager at the printer asks to add email back to the sign-in request, "so we can send receipts later". That is a reasonable thing to want. It is also a second purpose, and it deserves its own answers to three questions: what the address is used for, who can read it, and when it is deleted.
Answered that way, the receipt address belongs at checkout rather than at sign-in. Only people who place orders need a receipt, so the printer asks when Ava pays, and she can choose a different address for a gift order. The order system reads it, and customer support can read it while helping with an order. Marketing has no reason to. It is kept for as long as the printer keeps the order itself. Widening the sign-in release instead would collect every customer's email on every sign-in, including from people who never buy anything, with no stated purpose for most of them.
Keeping purposes apart also stops one collection from quietly serving another. An email address collected so Ava can recover her account is not a mailing list, and a phone number held for two-step verification is not a contact for delivery updates. Each value carries the purpose it was collected for, and the people and systems allowed to read it follow from that purpose.
The same ideas appear in law. For processing within its scope, the EU GDPR includes purpose limitation and data minimization among its principles. It is one legal framework among several, and which obligations apply depends on the people, purposes and jurisdictions involved. No framework provides a universal list of fields that every identity service must collect, so the questions above are where the design starts.
Verify the smaller design
A smaller design is only useful if it still works. The printer compares the two versions with the same task. Ava signs in with openid profile email, then twice with openid alone, and every time the printer receives the same sub and opens the same saved projects. Then it looks for anything that quietly depended on the missing fields. The welcome banner used to read the name claim, and it now says "Welcome back" when there is no name. A customer export used to fail when the email column was empty, and now it does not. A field that the decision never needed must not turn into a hidden requirement.
The check goes further than the sign-in screen. The printer's account API, its customer exports, the reports built from those exports, request logs, error reports and backups are all places where a field can survive after the sign-in stops asking for it. The copies collected under the broader design need a decision too: delete them, or keep them only where a purpose has been stated for them.
The printer still needs to explain its own decisions later. It can record that a discount was granted because of a college's enrollment statement, with the issuer and the date, without keeping a copy of the statement or the student record behind it. And when a new feature asks for a new field, the same three questions come first: what it is for, who reads it, and when it goes. A broad payload that arrived yesterday is not a reason for today's record to grow.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Release enough identity data for one decisionSign Ava in to an application with openid, profile and email, then with openid alone, and show the smaller release still recognizes her as the same returning account.