OAuth control levels and app review
On a self-hosted platform the operator’s policy is the trust anchor for which apps may ask users for consent: the operator chooses who may register apps, what an unreviewed app may do, and who reviews. This page is for operators; the OAuth flow itself is described in OAuth2 app authorization, and every configuration key in the OAuth2 operator guide.
The registration modes, the validation levels, the per-level policies and the badges come with open-pryv.io 2.0.0-rc.91. The review over HTTP and the current validation of granted apps come with 2.0.0-rc.92.
Registration modes
Section titled “Registration modes”oauth.clientRegistration.mode, the same on every core:
curated(the default): the operator registers every client withbin/oauth-client.js. An upgraded platform with an unchanged configuration behaves as before. A client a developer registered (origin: developer, left from adelegatedperiod) is not served while the mode iscurated:/oauth2/authorizeredirects back withunauthorized_client, the consent answers403 access_deniedwithreason: developer-clients-not-served, and its refresh is refused. Its row and grants are kept: switching back todelegatedserves it again.delegated: Pryv.io accounts may also register registry clients (origin: developer, owned by the registering account), under the operator’s policy below. The core refuses to boot with it when no OAuth extension is installed. Accounts register their apps with the developer API from open-pryv.io 2.0.0-rc.94: see Publish an app; before it, no command creates a developer’s client. A developer can register an app only onceoauth.clientRegistration.audienceslists the resource URLs its tokens may be used at (what developers may register).oauth.clientRegistration.whoMayRegister(delegatedonly):validatedPublishers(the default: only accounts whose publisher the operator validated) oranyAccount(the boot logs a warning).
From open-pryv.io 2.0.0-rc.93, mode, whoMayRegister and each levels.<level>.<setting> below can also be set once for every core in the platform store (an owner, with a recent second factor); a store value applies at once and replaces each core’s file value, except on a core that pins it (platform.configStore.localOnly).
Anonymous dynamic client registration (RFC 7591, POST /oauth2/register) is not offered: mode: open, and any other value, is refused at boot and by bin/check-config.js.
Validation levels and badges
Section titled “Validation levels and badges”The core decides, for every registry client, who vouches for it; the consent screen shows it as a badge:
| Client | Level | Badge |
|---|---|---|
registered by the operator (origin absent or operator) |
appValidated |
App Validated |
origin: developer, its app review passed and no reviewed field changed since |
appValidated |
App Validated |
origin: developer, its owner is a validated publisher |
publisherValidated |
Publisher Validated |
origin: developer, otherwise |
nonValidated |
Non-Validated |
client metadata document, oauth.clientMetadataDocuments.mode: allowList, its host listed in allowedHosts and not in deniedHosts |
publisherValidated |
Publisher Validated |
| client metadata document, otherwise | nonValidated |
Non-Validated |
An app review stores the digest of the reviewed fields with a review version. Version 1 covers the redirect URIs, keys, scope, audiences, grant types, roles and lifetimes, the display identity (names, description, logo, home, policy and terms URLs), and what else changes what the app does or who stands behind it (insecure redirects, subject type, maxEntries, DPoP binding, token response extras, application type, kind, CMC offers, the owner). Not covered: the regions, the status, the secrets (a rotation keeps the badge), contacts and softwareId. A client whose reviewed fields changed is not App Validated until reviewed again. A review is always compared with the list of its own version, so an upgrade never downgrades a reviewed app.
A publisher is the account that owns a developer’s client. Its status is a platform row: validated makes its apps Publisher Validated; absent, none, pending or suspended, it is not validated. Its display name (at most 128 characters) is answered only once validated.
The level is decided again at the consent and at each refresh. It is answered to the consent screen in the offer (client.validation = { level, publisher?: { name?, validated }, validatedAt? }, and client.origin: "developer" for a developer’s client), and stamped on the grant and its sessions (clientData.oauth.client.validation.level).
Per-level policies
Section titled “Per-level policies”oauth.clientRegistration.levels.<level>, for nonValidated, publisherValidated and appValidated (absent: everything allowed, as before):
consent:allow(the default),testersorrefuse.refuse:/oauth2/authorizeredirects back withunauthorized_client, the consent answers403 access_denied(reason: client-not-validated), and the refresh of grants already given is refused too (400 unauthorized_client; the refresh token is kept, so it works again if the level or the policy changes back).testers: only the client’s testers may consent: its owner account and, from 2.0.0-rc.94, the usernames its owner lists (testers), on every core; anyone else gets403 access_denied,reason: client-testers-only. A client without an owner (an operator’s or a metadata-document client) has no testers.
scopeTemplate: the widest scope a client of that level may get, in the OAuth extension’s grammar. A request that resolves to more is refused (invalid_scopeat/oauth2/authorize;400 invalid_scope,reason: client-scope-template, at the consent).openidandoffline_accessare not restricted by it.maxGrants(1 to 100 000): how many accounts a client of that level may reach; a new account past the cap gets403 access_denied,reason: client-grant-limit. Approximate by design: accounts consenting at the same moment at the cap may all be refused, and an account’s own revocation does not give its unit back (bin/oauth-client.js purge-grantsandrevokedo).
testers, scopeTemplate and maxGrants gate new consents only: grants already given keep their reach. To stop an app at once, suspend it; to end its grants, bin/oauth-client.js purge-grants. A policy block with a problem is refused at boot, and read anywhere else as “every level refused”. bin/check-config.js and the boot warn when appValidated is testers or refuse (the operator’s own clients would be locked out). Keep the block identical on every core. The consent and refusal audit records carry validationLevel.
What account apps show: current validation of granted apps
Section titled “What account apps show: current validation of granted apps”An account app lists the apps an account granted, with the badge of each as it stands now (an app may have lost its review, or be suspended, since the consent): POST /oauth2/clients/validation with { username, clientIds } (at most 50) and the account’s personal token. It answers, for each client the account granted, the validation block of the consent offer and served (false when the client is refused now). Ids the account did not grant are left out, without telling them apart from unknown ones.
Review over HTTP
Section titled “Review over HTTP”From open-pryv.io 2.0.0-rc.92 the review acts of bin/oauth-client.js (approve, withdraw a review, suspend, resume) and the decisions about publishers are also served over HTTP, under /system/admin/oauth, for the administration portal and scripts: the same code writes the row as the CLI does. The app-reviewer role holds every review permission; these permissions come only from grants at scope platform or region:<r>, and each route keeps to the rows the caller’s grants cover by region. From 2.0.0-rc.94 they also serve the review of developers’ submissions, and decisions are noticed to developers. How to review, step by step: Review apps and publishers.
From a core’s shell
Section titled “From a core’s shell”bin/oauth-client.js show and list print each client’s origin, owner and level, and show the review digest of a developer’s client. validate <clientId> --digest <digest> records the app review of the row show printed (refused when it changed since), unvalidate <clientId> withdraws it, suspend and resume change its status. The full command set is in the OAuth2 operator guide.

