Linking Identities Across Different Organisations

Linking Identities Across Different Organisations

Users from one organisation can be invited into another organisation so that they are granted access to certain companies in the other organisation. In order to connect organisations, there are 2 basic steps that need to be completed:

  • The inviter organisation needs to link the invitee organisation to their account
  • Then, the inviter can grant access to any identities in the invitee organisation provided they have been given the 'public key' of those users by the invitee organisation.

Linking organisations together requires an organisation admin from both organisations. All actions are performed via API so both users will need to have setup a token and be familiar with interacting with MachShip via the API. All our API documentation can be found in our API Documentation.

For the remainder of the article we will use the following two terms:

  • Inviter Organisation. This is the organisation that is granting another organisation's identities access to its account.
  • Invitee Organisation. This is the organisation that is requesting access to another organisation's company.
  • Organisation Administrator. This is a special role in MachShip and only an Organisation Administrator can perform the following steps in MachShip
Note: As mentioned above all four steps below have to be undertaken by a user that has the class of Organisation Admin. If you are unsure if your user is an organisation admin or would like to know who your organisation admin is please contact support@machship.com

Step 1. Invitee Organisation - Generate and Send Public Key

Every organisation in MachShip has a public key and this is an identifier that can be accessed for certain actions in MachShip. This key should be kept private and only shared with organisations that you wish to join. If the public key is compromised, you have the option of resetting your public key (note that this will not unlink you from any organisations that you are currently linked to).

The Organisation Admin from the Invitee Organisation can access their public key via the /apiv2/organisationLinks/getPublicKeyForOrganisation endpoint. Once retrieved, this should be securely sent to the Organisation Admin of the Inviter Organisation.

Once the Organisation Admin of the Inviter Organisation has the public key, they need to link the invitee organisation using that key. Note that organisation linking is single direction only. Once linked, identities from the invitee organisation can be added to the Inviter organisation, however the reverse is not allowed. To allow this, Step 1 and 2 would need to be completed in reverse.

The public key needs to be used in the /apiv2/organisationLinks/add endpoint. Once completed, identities from the invitee organisation can be granted access to the inviter organisation.

 

Step 3: Invitee Organisation - Retrieve Identity Public Keys

Now that the organisations have been linked, the Organisation Admin of the Invitee needs to get the public keys for all users that are being granted access to the inviter organisation. Again, the public keys for the identities should remain secure and only given to the organisation administrator for the inviter organisation. You would also need to ensure that you create all the users under the SSO Organisation - this will be how they will originally land into MachShip. Once this is done their Public Keys will be accessible. To get the public keys, you can get a list of all the user identities via the /apiv2/identities/getIdentities endpoint. You can then use the returned ids and pass them into the /apiv2/identities/returnIdentityPublicKeys endpoint. This will return you a list of the public keys and their corresponding identity Ids. These public keys should then be sent to the Organisation Administrator of the inviter organisation. The Public Key mechanism is only required if you wish to do this in bulk via API. If you wish to do this via the UI then you would just need to provide to the Inviter Organisation a list of the usernames created. These can be found by going Admin - View users in the SSO Organisation. 

 

Step 4: Inviter Organisation - Add the identities to specific Company and Role

Once the Inviter Organisation Admin has the public keys, they can grant access to these identities via the user interface via Admin -> View Users -> Link Existing Entity modal. Alternatively, this can also be done via API using the /apiv2/identities/linkIdentitiesToCompanies endpoint. Either process takes the following:

  • Public Key(s): this is the public key of an identity as provided by the Invitee
  • Selected Company: This is the company that you are granting access to for the corresponding identity. Company ids can be retrieved from either the API or from the URL of the view companies page in MachShip
  • Roles: Selected roles / an array of role ids that should be granted to the corresponding identity. Multiple roles can be specified. These ids can also be retrieved from either the API or from the URL of the view roles page.

Once complete, the linked identities will now have access to multiple companies in MachShip. A user can only access a single company at any one time. A user can switch between companies by going to the options at the top right corner of the MachShip UI and selecting 'Switch Company'.

Note, if you are a MachShip Owner then this can also be done via the UI. In the Create users section you will see Invite User




Here you can then put in the username provided by the invitee organisation, link them up to the correct company company and assign their role


 

See the flow below for the steps required to link organisations together