Skip to main content

Multi-Tenant Users

What You Will Build​

FormKiQ supports multi-tenant environments where you can set up multiple groups of users and provide each group of users access to their specific documents. This is done through a siteId. In this tutorial we are going to create two different siteIds, and then add both users and documents to each siteId.

You will create a new tenant site ID using Cognito groups, create a user, assign that user to the tenant, and verify that the user can add documents to that tenant.

Before You Begin​

  • Access to a FormKiQ installation that uses Amazon Cognito.
  • Administrative access to the Cognito User Pool.
  • An email address for a test user.

Workflow Overview​

  1. Create tenant Cognito groups.
  2. Create a tenant user.
  3. Add the user to the tenant group.
  4. Have the user complete setup and sign in.
  5. Upload a document as the tenant user.
  6. Verify the document appears only in that tenant context.

Step 1: Create Cognito Groups​

To create a SiteId, start by visiting the Amazon Cognito Console and select the User pool name matching your naming of your FormKiQ installation.

Cognito User Pools

Select the Groups tab and you'll see the Cognito groups that FormKiQ creates during installation. Each group is a siteId (except for the Admins) group.

FormKiQ default Cognito Groups

Create Tenant​

We are now going to create a siteId named site1. This involves creating two Cognito groups.

Select the Create group button.

The first group will be called site1. This group will give users read/write access to documents in the site1 siteId.

Enter the Group name of site1 and click Create group button.

Cognito Group Site1

The second group will be called site1_read. This group will give users read-only access to documents in the site1 siteId.

Enter the Group name of site1_read and click Create group button.

Cognito Group Site1 Read

Now you'll see the site1 and site1_read Cognito groups listed in the Cognito User Pool.

Cognito User Pools Site1

Step 2: Create Cognito Users​

The administrator created during the FormKiQ installation was placed in the default siteId. Now that the site1 Cognito group has been created, we are now going to create a new user and add that user to the site1 Cognito group. This means we will end up with two users, each in their own siteId group.

Click the Create user button to add a new user.

Cognito Users Tab

On the Create User page,

  • enter the Email Address of the user to create
  • select Send an email invitation
  • click Mark email address as verified
  • select Generate a password

Click the Create user button to finish creating the new user. The user receive an email at the specified email address, with a link to finalize setting up their account.

Cognito Create User

You'll now see both the user you just created and the administration user listed.

Cognito User List

Click your newly-created user and scroll down to the User Group Membership. At this point, the user does not belong to any groups/siteIds.

User Group Membership

Click Add user to group and select site1. Click the Add button.

Add User to Group

The user is now a member of site1.

Add User to Group

Lastly, ask your newly-created user to check their inbox for the Welcome to FormKiQ email. They can click the link within the email to finalize their account; this link will open FormKiQ Web and will allow the newly-created user to set a password for their account.

Welcome to FormKiQ

Your account has been created. *Click this link to finalize your account*.

Step 3: Add a New Document as the Site User​

Once logged into FormKiQ Web, the user can click Add Documents from the menu on the left side of the screen. They can drag and drop a file into the Upload New box. Once the document has been uploaded, it will be displayed in the Documents Added table.

Add Document to Site1

Clicking on Recent Documents from the left menu will display the newly-added document.

Site 1 Documents

Verify the Result​

Throughout this tutorial, you have successfully created a new FormKiQ user in Cognito. The newly created user was attached to a new siteId and was able to successfully add a document to this newly created siteId.

Confirm that the document uploaded by the site1 user appears in site1 and does not appear in the default site for users who do not belong to site1.

Clean Up​

Remove the test user and tenant groups if they were only created for this tutorial.

Troubleshooting​

ProblemLikely causeWhat to check
User cannot see tenant documentsUser is not in the correct Cognito group.Confirm membership in the site1 group.
User has read-only accessUser is only in the _read group.Add the user to the write group for that site ID.
User invitation does not arriveEmail delivery or user pool settings issue.Check Cognito user status and resend invitation if needed.

Next Steps​

Privacy settings

Analytics is optional. Your analytics choice is shared with formkiq.com and remembered for up to six months. Change it here at any time.

Essential preferences and search

We remember your privacy choice and display preferences. Search runs in your browser using Pagefind files hosted with the docs. It works whether you accept or reject analytics.

Measure page views and installation-link clicks. This does not enable advertising on the docs. Existing marketing choices for the main website are kept unchanged.

Read the docs privacy notice or manage other main-website privacy choices.