This primer is intended to accompany [SAI]. It is focused on providing a friendly introduction for developers of libraries intended for solid authorization agents.
This document was developed alongside the open-source TypeScript implementation [SAI-JS] and open-source Java implementation [SAI-JAVA].
2. Shape Tree
Shape Trees [SHAPETREES] allow for the definition and validation of data hierarchies including which shapes [SHEX] should be used to validate data. In our examples, we are going to use the following Shapes and Shape Trees.
Reference shape path documentation
3. Registry Set
Authorization Agent uses a set of different registries to perform its dutes. Specificaly,
each one of them is described in a dedicated section.
The Registry Set can be discovered from a social agent’s WebID Profile using
While WebID Profile is readable to the public, Registry Set should only be readable by its owner and their Authorization Agent.
4. Data Registry
A Data Registry is a collection of Data Registrations, each of which represents a unique type of data, identified by a shape tree.
In a Data Registry, there can be at most one Data Registration for any given shape tree.
4.1. Data Registration
Data Registration is a container, which contains Data Instances. Each of those Data Instances conforms to one specific shape tree assigned to the Data Registration.
Shape Tree used by this Data Registration
4.2. Data Instance
Data Instance is a resource representing something specific, for example, a project or a task. An Authorization Agent is not responsible for modifying data instances. Sometimes it still needs to access them during § 7 Gathering Authorizations from the user if the user wants to select specific data instances.
5. Authorization Registry
Authorization Registry is a container, which contains Access Authorizations. Each of those Access Authorizations is created for a specific grantee, and groups together one or more Data Authorizations.
5.1. Access Authorization
Access Authorization groups one or more data authorizations. Together they represent the whole access granted by a social agent to another agent. One of the primary responsibilities of the authorization agent is § 8 Generating Access Grant from Access Authorization.
An Access Authorization is immutable, it never gets updated, instead it can be only replaced with a newer Access Authorization.
5.2. Data Authorization
Data Authorization, similar to § 6.6 Data Grant, represents access granted by a specific Social Agent.
It is always associated with a specific § 2 Shape Tree. Depending on its scope it can apply to all the
Data Instances in any number of Data Registrations. In that case,
interop:hasDataRegistration will not be specified.
A Data Authorization is immutable, it never gets updated, instead it can be only replaced with a newer Data Authorization.
Data Authorization can have one of five scopes:
All the Data Instances in all the Data Registration the End-user has access to. This includes ones owned by the End-user as well as ones owned by others, where End-user has been granted access.
All the Data Instances in all the Data Registrations, owned by a specific social agent. This could be the End-user themselves or any other social agent who granted access to the End-user.
Plus all the Data Grant Scopes
6. Agent Registry
6.1. Agent Registration
There can be only one Agent Registration for any given agent in Agent Registry. Its main purpose is to make § 6.5 Access Grant available to the registered agent.
6.2. Social Agent Registration
Social Agent Registration is created for a Social Agent. Besides [[##access-grant]] it can also reference a § 6.2.1 Reciprocal Registration
6.2.1. Reciprocal Registration
The reference to reciprocal registration can be created after receiving an § 6.7 Access Receipt from another Social Agent and performing § 6.4 Agent Registration Discovery
In the case of Social Agent Registration for ACME, created in Alice’s Agent Registry. The reciprocal registration will be the Social Agent Reigstration for Alice, created in ACME’s Agent Registry.
6.3. Application Registration
Application Registrations are created by the End-user for applications they use. Since applications do not own or share data, they will never have a [#reciprocal-registration].
6.4. Agent Registration Discovery
Both Social Agent and Application can discover Agent Registration created for them,
GET request on IRI denoting
the Authorization Agent. Response will include HTTP Link header relating
Agent Registration to the agent making the request using
http://www.w3.org/ns/solid/interop#registeredAgent as link relation.
In a case where End-user using an application performs the discovery on their own Authorization Agent. The response will include a link to the Application registration.
In the case where the client acting on behalf of one social agent, performs the discovery on another’s social agent Authorization Agent. The response will include a link to Social Agent Registration.
6.5. Access Grant
An Access Grant grups together all the Data Grants provided for specific agent.
An Access Grant is immutable, it never gets updated, instead it can be only replaced with a newer Access Grant.
6.6. Data Grant
Each Data grant represents access granted by specific Social Agent, to all or selected Data Instances in specific Data Registration.
A Data Grant is immutable, it never gets updated, instead it can be only replaced with a newer Data Grant.
Data Grant can be consider as the most important data structure, it provides following information:
Social Agent who owns the data
Shape Tree used by related Data Registration
Data Registration that this Data Grant applies to. As well as
iriPrefixof that Data Registration (see § 4.1 Data Registration)
List of access modes defining what application can do with the data
Defines which instances can be accessed (see § 6.6.1 Scopes)
If grant has
InheritInstancesscope, it will be the Data Grant for Data Registraion with parent Data Instances (see § 6.6.2 Inheritance)
If grant has
SelectedInstancesscope, it will be all the Data Instances that application can access in the Data Registration
If Data Grant is issued by Social Agent other than data owner, it will be the original Data Grant issued by the data owner (see § 6.6.3 Delegation)
Data Grant can have one of three scopes:
All the Data Instances in the Data Registration. Application will be able to access the Data Registration and see the list of all contained instances (see § 4.1 Data Registration)
Only specific Data Instances in the Data Registration. Application will not be able to access the Data Registration, so it will not see the list al all contained instances. Instad list of selected Data Instances is available via
Only those Data Instances in the Data Registration, which are related to parent kData Instances in Data Registration of the Data Grant referenced with
inheritsFromGrant(see § 6.6.2 Inheritance)
InheritInstances Data Grant doesn’t provide access to the Data Registration, so
application can’t get the list of all the Data Instances. Neither it provides a list of specific
Data Instances in the Data Registration.
To find Data Instances from that Data Registration, application first needs to access parent
Data Instances from Data Registration which Data Grant referenced by
inheritsFromGrant makes accessible. Based on shape tree definition, each parent Data Instance will reference all its
child Data Instances.
Both parent and child Data Registrations have to be in the same Data Registry. Since only one Data Registration for specific shape tree can be created in any given Data Registry. All parent Data Instances are from one Data Registration and all child Data Instances are from one Data Registration.
Application doesn’t need to handle delegated Data Grants in any special way.
To know if Data Grant was issued by currently logged in user or someone else,
application should rely on
dataOwner information in the Data Grant.
6.7. Access Receipt
Access Receipt helps to establish data sharing between two social agents. Once received the authorization agent should prompt the user to approve creating § 6.2 Social Agent Registration for that data owner. If user approves § 6.2.1 Reciprocal Registration can be associated and subscription for notifications established to keep track on the latest § 6.5 Access Grant. Once reciprocal registration gets associated there is no further need for its data owner to send access receipts to the agent registered in that reciprocal registration.
6.8. Access Need Group
An Access Need Group is a collection of Access Needs used to communicate an access request to Social Agents.
An Authorization Agent uses them during § 7 Gathering Authorizations from the user.
6.9. Access Need
An Access Need represents the requirement of one specific type of data represented by a shape tree, as part of an Access Need Group.
Complete this section based on implementation of UI for Authorization Agent Service
7. Gathering Authorizations from the user
The most common case is authorizing an application based on its § 6.9 Access Need. The authorization screen should combine those Access Needs with existing § 5.1 Access Authorization if one exists. It should also assist the user in composing new Access Authorization, taking into account all their:
Data Registries with Data Registrations and Data Instances
8. Generating Access Grant from Access Authorization
Based on an § 5.1 Access Authorization, authorization agent can generate an § 6.5 Access Grant.
For § 5.2 Data Authorization using
a single § 6.6 Data Grant gets generated. Similar for data authorization using
Inherited scope and
inheriting from data authorization with one of those two scopes. Here a data authorization gets directly
translated into a data grant, only changing type and all authorization specific properties to grant specific properties.
For data authorization using
AllFromAgent, zero or more data grant gets generated.
This number depends on a number of Data Registries owned by the social agent giving the authorization,
as well as number of data grants given to them by other social agents. Data authorization with
will also have zero or more data grants if it is inheriting from data authorization using one of those two scopes.
Example of an implementation can be found in [SAI-JS] and [SAI-JAVA]