Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

Self-service sign-up and customer accounts

A sign-up form lets anyone start a relationship with a service, so what the form produces has to be decided carefully. This lesson follows Ava's registration at the photo service: treating what she typed as claims until they are checked, what an emailed code does and does not prove, handling a second registration for the same address, keeping roles out of the customer's reach, and planning recovery from the first day.

Registration creates a claim, then a relationship

Ava has been emailing holiday photos to her family for years and wants them in one place. She opens the photo service, chooses Create account, and fills in a short form: her name, the address [email protected], a new password, and a box to accept the terms of service. Then she presses the button.

Nobody at the photo service decided that Ava should have an account. This is self-service sign-up: whoever reaches the page can start a customer relationship without anyone approving it. That is what makes it convenient, and it is also why the service has to be careful about what the form produces. At this moment the photo service holds a few claims, things Ava has said about herself, and a request to create an account. It does not know whether Ava controls [email protected], whether the name is hers, or whether she should have anything beyond what every customer gets. Anyone on the internet could have submitted the same form with the same address.

So the photo service treats the submission as a pending registration rather than an account:

Pending registration   reg-7c41
Name, as typed         Ava
Email, as typed        [email protected]   (not verified)
Password               set, stored as a hash
Terms                  accepted, version of 2024-11-01
Code sent              2025-02-16 19:31 UTC, expires 19:46
Account                not created yet

All people, addresses, and identifiers in these examples are fictional.

Getting from that record to an account takes a few separate steps. The service first checks that the input is within bounds: a name of reasonable length, an address in a valid format, a password that meets its rules. It applies its duplicate and abuse checks, asking whether the address already has an account and whether this source has been sending hundreds of registrations a minute. It establishes the contact by sending a code to the address. Only then does it create the account, with the defaults every new customer receives.

The service also decides in advance what a pending registration may do, instead of allowing everything while a check is outstanding. Until the code comes back, nothing depends on [email protected]: no receipts are sent there, no shared albums are announced from it, and no password reset can be sent to it.

Verification has a narrow purpose

A minute later, an email arrives in Ava's inbox with a six-digit code that expires in fifteen minutes. She types it in. The photo service compares it with the hash it stored for reg-7c41, finds that it matches and is still in time, marks it used, and creates the account:

Account                    user-3117
Created                    2025-02-16 19:32 UTC
Created by                 user-3117, through self-service sign-up
                           (no administrator involved)
Email                      [email protected], verified 19:32 by emailed code
Roles                      none (ordinary customer)
Organization management    none

The record says exactly what the code proved: at 19:32, whoever completed the registration could read mail sent to [email protected]. That is contact verification, and it is useful. It says nothing about Ava's legal name, her age or where she works, and it grants no role. Ava both performed the registration and is its subject, and no administrator appears anywhere in it.

That limit matters most for business customers. Lantern Studio, a design agency, has a business account at the photo service with shared albums and its own administrators. If someone registered with an address at lantern.example and verified it, they would have proved they can read that mailbox and nothing more. Managing Lantern's business account takes a separate step, such as an invitation from one of Lantern's existing administrators or the sponsorship or proofing process Lantern has agreed with the photo service. The sign-up form never grants it.

user-3117, 19:32

Can read mail at [email protected]
Established
Legal name
Not established
Age
Not established
Where she works
Not established

Roles: none (ordinary customer)

An address at lantern.example

Can read that mailbox
Established
Works at Lantern Studio
Not established
Lantern administrator
Not established
Organization management
None

The sign-up form never grants it

Managing Lantern's business account takes a separate step, such as an invitation from one of Lantern's existing administrators.

What a verified code establishes, for Ava and for someone with a Lantern address. Control of the mailbox is the only thing either proves.

The code itself is a short-lived secret, not an identifier for the account. It works once, for fifteen minutes, for one pending registration. The photo service keeps it out of places it could leak from. Its logs record that a code was checked and whether it matched, never the code. When a service sends a link instead of a code, the token in the link can leak through browser history or through the Referer header when the page it opens loads content from elsewhere, so the page that receives it should not load outside content.

Once used, the code is spent. If Ava's browser resubmits the form, or she opens the email again tomorrow and enters the code again, the second attempt must not create a second account or repeat anything that already happened. Delivery can be uncertain too: the mail provider may have accepted the message and still not delivered it. The page says that a code was sent and may take a few minutes, and offers a new code that replaces the old one, rather than claiming the message certainly arrived or starting a fresh registration.

Duplicate accounts and sign-in choices

Later that evening, two more requests mention [email protected]. Someone types it into the sign-up form with a password of their own and never enters a code. And Ava's code is submitted a second time, from a browser tab restored after a restart. With Ava's own registration, the photo service has three decisions to make.

Illustrative: three registrations that use the same address
CaseContact verified?Code already used?Decision
Ava registers a new address and enters the code onceYesNoAdmit her as an ordinary customer, with no management role.
Someone registers the same address again without verifying itNoNoRefuse. The address already has an account, so send its owner toward sign-in or recovery.
Ava's used code is presented againYesYesRefuse. A one-use code cannot create a second account.

The second case needs care in both directions. The new registrant must not end up with a second account for the same address, and must certainly not take over user-3117. But the page they see should not announce that the address already has an account either, because that would let anyone check who uses the photo service. The form shows the same message it shows every registrant, asking them to check their inbox. The email goes to [email protected] and says that someone tried to register with this address, with links to sign in or reset the password. Only the person who reads that mailbox learns anything.

The same reasoning applies to sign-in choices. If Ava later chooses to continue with her mail service account, and its ID token reports [email protected] as verified, the matching address is not a reason to attach that sign-in to user-3117 automatically. The photo service connects the two only after Ava proves control of the existing account, for the reasons in Linking accounts.

Ava can change some things about her account on her own: her display name, her delivery address, the albums she shares. Other things about it are not hers to set, such as whether her address is verified, which organization she belongs to, and which roles she holds. Suppose she sends a profile update that tries both:

PATCH /account/profile HTTP/1.1
Host: photos.example
Content-Type: application/json

{"family_name": "Administrator", "role": "admin", "email_verified": true}

HTTP/1.1 400 Bad Request
Content-Type: application/json

{"error": "field_not_editable", "fields": ["role", "email_verified"]}

The form Ava normally uses has no role or verification fields, but hiding them is not what protects them. Anyone can send this request without the form, so the server decides which fields this account may change, using its current authorization rather than the shape of the page. Sent on its own, the name change would succeed, and Ava's profile would read "Ava Administrator". Nothing else would change: a name is something a customer may choose, and a role is something only an assignment can give.

Recovery belongs in the first design

Ava's account will outlive some of the things it depends on. She will replace her phone, and her email address may stop working, as Sora's did after Sora left Cedar in Customer and workforce identity compared. The photo service plans for that from the first day: a way to recover the account and replace a lost credential, with protection that fits what the account holds, and a notice through an established channel whenever something important changes, such as the password or the email address. Enrollment, replacement, and recovery describes what makes a recovery route trustworthy.

New requirements can break recovery by accident. Suppose the photo service decides that every account must add a passkey at its next sign-in. A customer who signs in only from a shared family computer cannot do that, and a hard requirement would lock them out of years of photos. Introducing the passkey as an option first, and keeping a working recovery route for people who cannot enroll yet, avoids permanent lockout that nobody intended.

Everything Ava's address met on that first evening, from the expiring code to the refused role, served one result. A page that says "success" was never the goal. The goal is one account per person, scoped as an ordinary customer, with a verification state the service can trust and a lifecycle the customer can actually use.

Check your understanding

Try these questions before moving on. If an answer isn't right, use the feedback and try again.

Ava enters the emailed code and the photo service creates user-3117. What has the code established? 1 of 3

Choose one answer.

Someone registers [email protected], which already belongs to user-3117, with a password of their own and never enters a code. What should the photo service do? 2 of 3

Choose one answer.

Ava's profile form has no role field. She sends PATCH /account/profile directly, with a new family name, "role": "admin" and "email_verified": true. What should the photo service do? 3 of 3

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity