API Authorization Quickstart
The API Authorization scenario is an example of how to implement a data-centric authorization model for services and endpoints using a relationship-based access control (ReBAC) model.
Tutorial video
If you'd like to view a tutorial video of what this quickstart will cover, check it out below.
Quickstart contents
The API Authorization Quickstart includes:
- A domain model for API Authorization, including the
system,tenant, andresourceobject types.- The
systemtype is meant to be a singleton representing the entire system, which hasadmin,editor, andviewerrelationships, representing roles that extend across all tenants. Theadminrole grants thecan_create_tenantpermission. - The
tenanttype represents tenants within the system. It hasowner,admin,editor, andviewerrelations that grant permissions such ascan_administer,can_edit, andcan_view, as well as fine-grained permissions such ascan_delete_tenant,can_manage_members,can_list_members, andcan_leave_tenant. This last permission is granted to anyone except for owners, who can only be removed by other owners. It also has permissions relating to resources - includngcan_create_resources,can_delete_resources,can_write_resources, andcan_read_resources. - The
resourcetype has atenantrelation that links it to the parent tenant. It also hasowner,writer, andreaderrelations that grant permissions such ascan_delete,can_write, andcan_read. These permissions are also granted through roles on the parent tenant.
- The
- A policy instance called
multi-tenantwhich uses a boilerplate authorization policy calledpolicy-rebac. This policy simply uses the underlying relationships to determine access. - A connection to the Citadel Demo IDP, which contains five demo users based on the Rick & Morty cartoon.
- Sample object instances, including a system singleton called
The entire system, tenants such asCitadel tenantandSmiths tenant, and resources such asThe Citadel adventures resource(in the Citadel tenant) andThe Smiths family's budget(in the Smiths tenant). Rick, Morty, Summer, Beth, and Jerry haveowner,editor, andviewerrelationships to the system, tenants, and resources, demonstrating a relationship-based (ReBAC) model. - A back-end API that uses the
multi-tenantpolicy for authorization, implemented in several languages. - An interactive tutorial which helps construct
curlrequests to test the back-end API.
As you go through the Quickstart, you'll learn the following:
- How to instantiate the API Authorization template.
- How to browse the directory and examine the manifest.
- How to evaluate policy decisions within the Aserto Evaluator.
- How to download and run the API Authorization back-end API.
- How to construct
curlrequests to the back-end in order to test out the API.
Prerequisites
To follow this Quickstart you'll need to have an Aserto account. If you do not have one, you can create one here. Once you have created your tenant, you can continue.