Account lifecycle
What happens to your application's grants, tokens and data when a user's email address is changed by onefold staff, they reset their password, remove your application, or their account is disabled and restored.
A user's account changes without your application being involved: onefold staff change its email address, the user resets their password or removes your application, or the account is taken out of service. This page says what each change does to your application's access, and which webhook tells you.
Summary
| What happens | Your tokens | Their grant | Your metadata | Webhook |
|---|---|---|---|---|
| The user changes their username or profile | Keep working | Stays | Stays | profile.updated |
| onefold staff change the email address on the account | Stop working | Ends when the new address is confirmed | See below | profile.disabled, then consent.revoked |
| The user confirms an email address that was not verified | Stop working | Ends | See below | consent.revoked |
| The user resets their password through recovery, or has it set by the platform's operators | Stop working | Ends | Stays | consent.revoked |
| The user removes your application | Stop working | Ends | Stays | consent.revoked |
| The user moves to another email address | Stop working for the previous sub | Moves with the user | Moves with the user | subject.changed |
| onefold staff hold the account | Refused until the hold is released | Stays | Stays | profile.disabled, then profile.restored |
| The account is disabled | Stop working | Ends | Deleted | profile.disabled, then consent.revoked |
You can also end a grant yourself, from the application's Users tab. That has the same effect on your tokens as the user removing your application.
Email address changes
A user cannot change the email address on their account themselves. They ask the operator of the platform, and onefold staff change it. The new address is not verified: nobody has proven they can read it.
- Applications that knew the user receive
profile.disabled. No event carries the address; reademailandemail_verifiedfrom the management API or userinfo. - Your tokens for the account are refused from then on, and the user is signed out of onefold on every device.
- The grant ends when the person confirms the new address. See Confirming the address.
subdoes not change.
This is why you key users on sub. An application that matches users by email address loses
track of a user whose address is changed.
A user moves to another email address
A user can move their profile in your organization to the account of another email address they control. An administrator of your organization can also ask for the move; the user's current address is told and can cancel it for seven days. Nothing about the user's sign-in methods or other organizations changes.
After a move, your application knows the user by the other account, so their sub
changes:
- You receive
subject.changedwith the old value inprevious_suband the new one insub, followed byprofile.succeeded, or byprofile.mergedwhen that account already had a profile in your organization. - Your tokens for the previous
substop working. - The user keeps their access to your application. Their next sign-in to it shows the consent screen again.
Re-key what you store about the user from previous_sub to sub when subject.changed
arrives. If you missed the event, a lookup by the
previous sub answers with the user under the current one.
Password reset
A user who resets their password through Forgot password? is signed out of onefold
everywhere, and every application's grant for that user ends. Your tokens for them stop
working at once; a refresh answers invalid_grant.
Send the user through sign-in again. They approve your application again and you receive new tokens. Your metadata about them is unchanged.
The same is true when the platform's operators set a password for the account, which they do
to recover one that may be in the wrong hands: the user is signed out everywhere, your grant ends, and you receive
consent.revoked. A password changed on the Security page, with the current password entered, ends
the account's other sessions and nothing else.
A user removes your application
A user can remove your application from their authorized applications at any time. The grant
ends, your tokens stop working, and you receive consent.revoked.
The management API stops returning the user immediately. If they authorize your application
again, they return with the same sub.
Account disabling
A user cannot delete their own account. They ask the operator of the platform, and onefold staff disable it. When an account is disabled:
- Applications the user had authorized receive
profile.disabled. - Every grant ends, every token stops working, and you receive
consent.revoked. - Your metadata about the user is deleted.
On profile.disabled followed by consent.revoked, delete or anonymize what your application
holds about that sub.
Restoration
A disabled account comes back when its holder signs in again, with a password, a passkey or an
emailed code and then their second factor if they have one. There is no time limit. A restored
account keeps its sub, but it does not get its grants back: the user authorizes your
application again, and the metadata that was deleted is not restored. You receive no event for
the restoration; consent.granted tells you the user is back.
Do not treat a disabled account as reversible. If a user returns after their account was disabled, treat them as a returning user whose data you removed.
Accounts that can no longer sign in
onefold refuses tokens that belong to an account that is disabled or held, or whose email
address is not verified. Userinfo answers 401 and a refresh answers invalid_grant, as for
any revoked token.
When onefold takes an account out of service
onefold staff can hold an account, or mark its email address as not verified — which is also what happens when staff change the address on an account.
- A held account. Your tokens for it are refused until staff release the hold, and the same
tokens work again afterwards. You receive
profile.disabledwhen the hold is placed andprofile.restoredwhen it is released. - An address marked as not verified. Applications that knew the user receive
profile.disabled. Your tokens for the account are refused from then on, and the grant ends when the person confirms the address.
In both cases the person is signed out of onefold on every device.
Confirming the address
An account whose email address is not verified is confirmed by the person who owns the
address. When that happens, every grant the account held ends: your tokens for it are
revoked, not restored, and you receive consent.revoked. Send the user through sign-in again;
they approve your application again and keep the same sub.
Your metadata about the user is deleted when the address had never been confirmed on that account, and kept when the account had been verified before.
What your application should do
- Key every user on
sub. - Treat a refused token as a signed-out user, and send them through sign-in.
- Subscribe to
consent.revoked,profile.disabledandsubject.changedso that your own records follow. - Read
emailandemail_verifiedwhen you need them, instead of storing them once.
Organization profiles
The profile your organization keeps of each person, its built-in, shared and private fields, who may read and write each field, and the hosted account page where people manage it.
Analytics
Read sign-in, authorization and user analytics for your onefold application, and its administrative activity.