Skip to main content

Who Gets In: IAM People and Groups (ADR-046)

Signing in with the organization account does not grant access to every application of it. Who may open your application is decided before it, by the platform (ADR-046): the application receives who has already been authorized and never receives anyone's groups. Reading the person is the code's job; deciding who gets in is not.

The Three Modes​

In the console, on the web service page, the access mode sits right below the organization sign-in, next to the lists of people and groups:

ModeWho gets in
Private (Privado, the default when you turn the sign-in on)only who is in Authorized people (Pessoas autorizadas) or is a member of one of the Authorized groups (Grupos autorizados)
Organization (Organização)any active person in the organization's IAM
Public (Público)anyone; whoever has a session receives the identity

The Authorized people and Authorized groups lists change without a deployment and belong to whoever administers the service's access in the project. Choosing Organization or Public belongs to the organization administrator: publishing does not give you the right to open the application to the whole company.

On the Zero API, the policy is read with GET /api/v1/services/{id}/access-policy and changed in …/access-policy/mode, …/access-policy/users and …/access-policy/groups. There is no CLI command for access, and the SDK does not generate these operations yet: whoever configures it uses the console or the API.

IAM Groups​

Allowing a group grants access to whoever is in it. The platform asks the IAM whether the person belongs to the group — it never copies the member list —, keeps the answer for at most 60 seconds, for this application only, and denies when the IAM does not answer. Whoever leaves the group loses access within one minute, also on connections already open: in the Private and Organization modes, WebSocket and SSE last at most 45 seconds, and the reconnection goes through the check again.

The grant keeps the group identifier, not the name: a group recreated under the same name does not inherit the allowances.

Only the groups the IAM administrator made available to applications appear for you to allow. While there is none, the screen says so and the allowance is per person. The directory stays in the IAM, with the members managed there.

Who Has No Access​

Whoever arrives without a session is taken to the sign-in, on navigation, or receives 401 on the API. Whoever signed in and is not allowed receives 403 — on navigation, the page says the person has no access to this application — and never reaches the application.

Hence the rule that settles the matter in the code: if the request arrived with a person, that person is already authorized. Do not check groups to decide who gets in: repeating the rule in the application creates a second policy, which diverges from the one the console shows.

What the Identity Does Not Carry​

The signed identity the application receives has no groups, roles, realm_access nor resource_access, and its contract refuses any field that is not foreseen. Code that looks for groups in the header always gets an empty list — on purpose: spreading the organization's directory across every application is what the design avoids. The policy stays in one place, the one the console shows.

Do Not Read the Header by Hand​

Use the SDK: nn.auth.user(req) in TypeScript, nn.auth.user(request) in Python, nn.auth().user(…) in Java. It checks the signature and returns the person. Decoding X-NNumbers-Identity without checking the signature accepts anything — and, even checked, the identity has no group to read. In another language, follow the runtime protocol.

The X-NNumbers-Identity header still exists: it is how Zero delivers the verified identity. It is the internal contract between Zero's identity broker and the official SDK (ADR-046 D15):

WhoReads X-NNumbers-Identity?
Zero's identity brokeryes: it issues the assertion and checks it
the official SDK (TypeScript, Python and Java)yes, checking signature, issuer, audience, organization and expiry
the application codeonly through the SDK, for identity and authorization
the browsernever receives the assertion: the edge removes the header coming from the client
code that looks for groups in the headerno: the assertion has no groups

The application's other HTTP headers (Accept-Language, Content-Type and its own) remain free; the restriction applies only to the identity assertion. The platform cannot stop the application from reading a header it received — the rule is that such a read is not a trustworthy source of identity or authorization.

Roles Inside the Application​

Who edits and who only views still do not come from the platform: the per-application roles (appRoles in the identity) are the next step of ADR-046 and do not exist today. When they exist, they will arrive as verified appRoles, through the contract and the SDK, without exposing the organization's groups. Until then:

  • if the application needs roles, keep them yourself, indexed by user.id — the person's identifier in the IAM, stable. Never by email, which changes and does not identify the person;
  • if all you want is to separate audiences — one area for Finance, another for everyone —, publish separate services, each with its own group list.

Next Steps​