This guide describes how persons partitioning works and will guide you through the steps required to configure it.
Persons partitioning divides persons repository into partitions. It means that person must be unique within each partition, where uniqueness is achieved by partition identifier and email address. Thanks to this solution Onegini IDP can have more than one account with the same email address.
The idea behind this feature is to replace multiple Onegini IDP instances with only one.
What is required?
To successfully complete this topic guide you need to ensure following prerequisites:
- Onegini IDP instance must to be running, for the sake of this guide we assume it's available under http://idp-core.dev.onegini.me address
- access to Onegini IDP extension project
- external idp needs to be added in Onegini IDP admin panel, e.g. facebook or ldap
The implementation requires following steps to be done:
- Implement required interface
PreSessionProcessExtensionon extension level. Interface is responsible for determining which person partition will be used in case of web browser access. It consumes
hostnameand should return related
- Implement optional interface
PartitionIdListProvideron extension level. Interface is responsible for returning list of available
IDP_PARTITIONING_PERSONS_ENABLEDto true on extension level.
Partitioning in the web layer works without additional steps but API and SAML requests require
X-Onegini-Persons-Partition-Id header to be set.
It should contain partition id to be used, if no header specified then default partition is used.
Prepare environment to support two domains on prepared Onegini IDP instance and add partitioning support for them.
Web layer scenario:
- Create a user in the first domain.
- Go to the second domain. Creating a user with same email address should be possible.
- Go to the first domain and use configured external idp to log in.
- Go to the second domain and log in with configured external idp by using the same credentials as in previous step.
- Change email/phone in the second domain and logout.
- Get back to the first domain and use external idp to log in. You should not see any changes done on the account in the second domain.
API layer scenario:
- Create a proper API request to create user.
X-Onegini-Persons-Partition-Idheader with person's partition id related to first domain. Execute a request.
- Try to login via browser on first domain - should be successful.
- Go to second domain. Login should show wrong credential page when you provide the credentials that was used to create account via API.
Supported API endpoints