Identity and access
Principals and identities
Every user, service and device account in Factory+ is a principal with a UUID, and names such as Kerberos principals map onto it.
A principal is anyone or anything that makes requests or holds permissions in Factory+.
Every request is made by a principal, and every permission is granted to one. A principal may be a person, a central service, an Edge Agent or a third-party application. Each principal is identified by a UUID. Permissions, ownership and configuration all refer to that UUID, whichever protocol the principal uses to sign in.
A principal is not the same thing as a login name. A person signs in with a Kerberos principal name, a browser application presents an OpenID Connect token and an Edge Agent publishes from a Sparkplug address, and all three names can belong to one principal. Factory+ therefore keeps the principal separate from its identities. The principal is the UUID, its identities are the names it is known by, and the Auth service holds the link between them.
A principal is a Configuration Store object
A principal is an object in the Configuration Store that is a member of the class Principal. The membership may be direct or through a subclass.
11614546-b6d7-11ef-aebd-8fbb45451d7cBecause a principal is an ordinary Configuration Store object, it has everything other objects in the object model have. Its Object Registration entry records its primary class and owner. It can have a name in the General Information app, and it can hold configuration in any other app. A principal is an individual, meaning a rank 0 object, and the classes that group principals together are rank 1 classes that are subclasses of Principal.
The authorisation model depends on this membership. An Auth service MUST NOT give an ACL to a UUID that is not a member of Principal. An account that exists in Kerberos but has no principal object can therefore authenticate to a service and still has no permissions at all.
Creating a principal
A principal is created in three steps, either by hand or by a provisioning tool.
- Create a Configuration Store object whose class is one of the principal types, for example Human user. Give it a name in the General Information app.
- Create the account in the identity provider, such as a Kerberos principal in the realm’s key distribution centre (KDC).
- Link the two by adding the identity to the principal in the Auth service, with
PUT /v2/principal/{uuid}/kerberos.
The object created in step 1 is owned by the principal that created it, as with any Configuration Store object. Its owner matters to grants on the Mine special target, as described under Ownership.
Identities
An identity is a name by which a principal is known in one naming system. The Auth service stores each identity as a record of principal, kind and name. Two rules apply to them.
- A principal has at most one name of each kind.
- A name belongs to at most one principal within its kind.
These rules make the mapping work in both directions. A service can turn a Kerberos name into a principal UUID, and a client can find the Kerberos name of a principal. An attempt to give a name to a second principal fails with 409 Conflict.
Two identity kinds are defined.
| Kind | Name format | Status |
|---|---|---|
kerberos | A Kerberos principal name, name@REALM | In use. It is the only kind an Auth service lists at GET /v2/identity. |
sparkplug | A Sparkplug Edge Node address | Reserved. Sparkplug addresses are held in the Configuration Store instead, as described under Sparkplug addresses. |
75556036-ce98-11ef-9534-637ef5d374567c51a61a-ce98-11ef-834a-976fb7c5dd4cKerberos
A Factory+ deployment needs a Kerberos realm, because Kerberos is the identity of record for services, Edge Agents and people. Each of them has a Kerberos principal. Every service checks Kerberos credentials when they are presented, as described in Authentication. Any Kerberos implementation can provide the realm, including an existing directory service that the site already runs.
A Kerberos principal name has the form name@REALM, for example jsmith@EXAMPLE.COM or sv1directory@EXAMPLE.COM. The name part MAY contain letters, digits and the characters _, ., / and -, and these allow instance names such as nd1/cell-01@EXAMPLE.COM. Realms are conventionally upper case, but an Auth service SHOULD accept the realm as it is given and compare names exactly.
Kerberos needs keys on the server side as well as the client side. Each HTTP service holds a key for the service principal HTTP/<hostname>, and with that key it can accept Negotiate authentication and verify passwords. The MQTT broker holds a key for mqtt/<hostname>. Each service that calls other services also has a client principal of its own, and that client principal is its identity as a Factory+ principal.
Cross-realm trust
Kerberos realms can trust each other, and a principal from one realm can then authenticate to services in another. Factory+ supports this without any special handling, because a principal from a trusted realm presents an ordinary Kerberos name such as jsmith@OTHER.EXAMPLE.COM. The deployment still decides what that person may do, because the name gets permissions only once it is linked to a principal UUID in the local Auth service, in the same way as a local name. Setting up the trust itself is a Kerberos administration task and is outside the framework.
Sparkplug addresses
Many principals publish Sparkplug data, and the MQTT broker needs to know which Sparkplug Edge Node address each one may publish from. Factory+ records this in the Configuration Store rather than in the Auth service, as an entry in the Sparkplug address app on the principal’s UUID.
8e32801b-f35a-4cbf-a5c3-2af64d3debd7The entry holds the group and node of the address:
{
"group_id": "Example-Cell-01",
"node_id": "Edge_Agent"
}
An MQTT permission template that refers to %g and %n reads this entry on the grant’s target. A single grant such as “Participate as Node on Self” therefore lets each Edge Agent publish only on its own address, as the worked example in Authorisation shows. To find the principal UUID for a Sparkplug Node address, a client searches this app for an entry with that group_id and node_id and no device_id.
OpenID Connect
A deployment MAY also let people and applications sign in through an OpenID Connect (OIDC) provider. The provider issues a JSON Web Token (JWT) that carries the principal UUID in the fp_principal_uuid claim. Services accept that token as a bearer credential. An OIDC sign-in does not create a new kind of principal. The token stands for the same principal UUID as that person’s Kerberos name, and the same grants apply whichever way they signed in.
How the provider finds the principal UUID for a user is up to the implementation. A provider that checks passwords against the Kerberos realm can look up the user’s Kerberos name in the Auth service with GET /v2/identity/kerberos/{name}. That lookup needs the Read Kerberos mappings permission on the Wildcard target. A token without fp_principal_uuid is refused. A provider with its own service accounts, for example for the OAuth client credentials flow, therefore needs a principal object for each of them.
Principal types
The framework defines a standard set of rank 1 classes for the different kinds of principal. Each is a subclass of Principal and a member of the rank 2 class Principal type. A deployment SHOULD create every principal as a member of exactly one of these classes, because then tools and people can tell what kind of account a UUID is. A deployment MAY create subclasses of them for its own purposes.
ae17afe0-ccff-11ef-bb70-67807cb4a9df8b3e8f35-78e5-4f93-bf21-7238bcb2ba9de463b4ae-a322-46cc-8976-4ba76838e90897756c9a-38e6-4238-b78c-3df6f227a6c900da3c0b-f62b-4761-a689-39ad0c33f86469b0f40a-cd00-11ef-b490-ab964303209d6c5fda5c-cd02-11ef-b4d4-c7be8081480fPrincipal groups
Grants are often given to a group of principals rather than to each one, and Factory+ uses the Configuration Store class model for this. Any subclass of Principal is a principal group. A grant to that class applies to every member of it, directly or through its own subclasses. The principal types above are principal groups, and a deployment can add its own, for example a class Line 3 operators with people as members.
The rank 2 class Principal group holds the classes of principals, with Principal itself as a member. It is the powerset of Principal in the sense of the object model. Principal type is a subclass of it.
c0157038-ccff-11ef-a4db-63c6212e998fMembership of a principal group is edited through the Configuration Store, with the Configuration Store’s own class membership permissions. The Auth service picks up the change from there. Authorisation explains how group grants expand.