Organization IAM for Applications
With Organization IAM turned on, people sign in to your application with the account they already have in the organization that owns the project, the same one they use to sign in to the Zero console. The application only reads who signed in:
const user = await nn.auth.user(req) // the person, or null
The application does not configure OIDC, does not keep a session, and does not receive an identity provider token, a refresh token or a secret. Nothing is created in the organization's IAM for the application: the sign-in is the same one as the Zero console. There is nothing to copy into variables or secrets, and nothing to request from the IAM administrator. If the organization has QueryMesh configured, the application can use this same identity to query it.
In the console: Login and data
In the console, the two capabilities appear under the name of their effect, in a place of their own called Login and data (Login e dados):
| In the console | What it turns on | Technical name (CLI and API) | When it takes effect |
|---|---|---|---|
| Organization sign-in (Login da organização) | People who enter the application use the organization's account (IAM) | organization-iam | With the service's next deployment |
| Infinite Data access (Dados do Infinite Data) | The application queries Infinite Data on behalf of who signed in (QueryMesh) | querymesh | Immediately, without deploying |
There are two ways to get there:
- On the web service page, the Login and data card, right below the summary (also in the service's Settings tab): one row per capability, with the state and the Turn on or Turn off button.
- Under the project's Settings → Login and data, right after Security: one row per web service in the project, with both capabilities side by side. Login and data apply only to web services.
The button opens a dialog that says when the change takes effect before you confirm. The Infinite Data address belongs to the organization and is configured under Settings → Integrations, at the organization level; while it is not ready, the Infinite Data access row points there.
Who It Is For
- Organization applications, such as dashboards, internal tools and portals, deployed as a web application with Zero's public address.
- Anyone who needs to know who is using the application to decide what to show, without building a sign-in.
What the Application Receives
| Field | What it is |
|---|---|
id | the person's identifier in the organization's IAM |
username, name, email, emailVerified | when the account has them |
organization | { id, slug } — the project's organization |
iam | the address of the organization's IAM |
sessionId | a reference to the platform session (not the cookie) |
How It Works
Organization IAM
│
OIDC
│
▼
Zero Identity Broker
│
the person's session
│
┌────────┴─────────┐
│ │
▼ ▼
Zero App Zero UI (console)
│
│ optional
▼
QueryMesh
│
▼
TrustLayer
The OIDC client is shared at the Zero and organization level: it is the same sign-in as the console, and there is not one per application. The application receives no client secret and no refresh token — the session, with the tokens, stays in the platform. QueryMesh is optional: an application that does not turn it on keeps just the sign-in.
- The person opens the application. Without a session, the application decides: show the public part or send them to sign in.
- The sign-in happens in the organization's IAM, on the same screen as the console and with the organization's rules (password, second factor). Someone who already signed in to the console or to another application of the organization does not type the password again.
- On the way back, the browser briefly passes through the Zero console address: that is where the IAM returns every sign-in of the organization. The platform takes the person back to the application and keeps the session.
- On every request, the platform checks the session and hands the application a signed identity, valid for 5 minutes and only for this application. The SDK checks the signature and returns the person.
The paths under /.nnumbers/ belong to the platform, on the application's own address:
| Path | What it does |
|---|---|
/.nnumbers/auth/login?return_to=/dashboard | signs in and returns to the requested path (only a path of the application itself) |
/.nnumbers/auth/logout | signs out of this application — a POST from a form of the application itself |
/.nnumbers/auth/session | the session state, for the browser |
What the Platform Guarantees
- The identity cannot be forged. On the way in, the platform removes any identity header coming from the browser. The identity it hands over is signed and valid for one application only, for 5 minutes. An application does not accept the identity handed to another one, nor one from another organization.
- No credential in the application. There is no client secret. The IAM tokens stay encrypted in the platform and do not reach the application, not even to query QueryMesh.
- The organization is in charge. The sign-in is the one of the project's organization's IAM, and there is no way to point to another. If the person is deactivated or the session is ended in the IAM, the application session goes down within minutes.
- The session has limits. It ends after 30 minutes without use or 12 hours in total.
- Signing out belongs to the application. Signing out ends the session only in that application. The organization sign-in remains valid, and signing in again may not ask for the password while it lasts.
- Who gets in is decided before the application. The application receives who has already been authorized, not the IAM groups. The allowed people and groups and the three access modes are in who gets in.
The platform session cookie reaches the application, because the address is the same. It cannot be used to forge an identity, but do not log it or pass it on.
Limits
- It works on the public address Zero gives the project. Custom domains do not have Organization IAM yet.
- Web applications only.
- The organization needs its IAM connected to Zero, the same sign-in as the console. There is no other step, neither per organization nor per application.
- In the organization's IAM, the applications' access shows up as Zero's, the same as the console, and not as a separate application.
- In the console, Organization IAM is turned on under Login and data — on the web service card or under the project's Settings → Login and data —, as well as with the CLI and the API.
- The in-application runtime is in the TypeScript SDK —
@nnumbers/zero/appon the server and@nnumbers/zero/reactin the interface — and in the Python and Java SDKs. In another language, follow the runtime protocol. - To query organization data on behalf of the person, the organization configures QueryMesh, and the application turns on the
querymeshcapability.
Next Steps
Was this page helpful?
Report a problem on this pageDo not send passwords, keys, tokens, or customer data.