Use this method for internal realms. To create an org using the JavaScript mapping feature of the Profile mappers, proceed as follows:
- Go to the Authentication menu, and select the Realms tab.
- Edit or create an SSO realm.
- Select Run configuration assistant.
-
Enter credentials for a user that belongs to the realm.
Enter your own email address, for example.
-
Select Search.
The JavaScript mappings editor appears.
-
Under JavaScript mappings, enter JavaScript code to assign users to orgs.
For example, the following codeblock assigns users whose email address ends in
@mycompany.comto theemployeesorg, while users with an@othercompany.comemail address go to thepartnersorg.The key property in this example is
user.orgs. Setuser.orgsto an array of org names to control which orgs the user belongs to.let user_email = attributes.emailAddress; // Edit this object to map email addresses to orgs // Pattern: "@company.com": "org_name" let domainOrgMap = { "@mycompany.com": "employees", "@partner.com": "partners" }; // Assign orgs based on email domain // IMPORTANT: user.orgs is the property that determines org membership // It must be set to an array of org names, for example: ["employees"] for (let domain in domainOrgMap) { if (user_email.endsWith(domain)) { user.orgs = [domainOrgMap[domain]]; break; } } -
Select OK to save the profile mapper code.
- Select OK to save the realm.
- Select Save.
The org is created when the first user belonging to the org logs into Fluid Topics. Users belonging to the org receive the corresponding roles, groups, and tags upon their next login.
Log out and sign in again to immediately create the org, if you belong to it (through your email domain, for example).