When you sync user groups from Okta, you may observe that only a (small) subset are received in the vault.
In such a case, that would mostly be groups with Okta type "OKTA_GROUP" and "BUILT_IN". You may not see "APP_GROUP" type of groups. This means only "internal" Okta groups will be synchronized, but external ones (such as those coming from Active Directory) will not.
In the Windows Event Logs you would see only information messages similar to:
Retrieving groups from Okta with filter:
Type eq "OKTA_GROUP" or type eq "BUILT_IN"
Another symptom is getting an " Object reference not set to an instance of an object " exception similar to the one below when you try to select a group to sync via the dropdowns or type a name in the textbox and click Show.
System.NullReferenceException: Object reference not set to an instance of an object.
at MFiles.Synchronization.Okta.Synchronization.GetGroupMembers(ISynchronizationStringDictionary pluginConfiguration, String groupNameWithDomain, Int32 maxCount, GroupImportMode importMode)
PropertyPageImportUsers.cpp, 2314, Object reference not set to an instance of an object. (0x80131600)
PropertyPageImportUsers.cpp, 1680, Object reference not set to an instance of an object. (0x80131600)
RPCMethodCallWithRetry.h, 182, Object reference not set to an instance of an object. (0x80131600)
RPCMethodCallWithRetry.h, 182, Object reference not set to an instance of an object. (0x80131600)
RPCVaultLoginsAdmin.cpp, 1445, Object reference not set to an instance of an object. (0x80131600)
RPCVaultLoginsAdmin.cpp, 596, Object reference not set to an instance of an object. (0x80131600)
RPCUserGroupsHelper.cpp, 3914, Object reference not set to an instance of an object. (0x80131600)
RPCSynchronizationHelper.cpp, 798, Object reference not set to an instance of an object. (0x80131600)
(M-Files 22.3.11237.3)
Details
The most likely cause for this behavior is that the Domains setting in the plugin configuration is not set to include the actual domain of the user groups. Only when an actual domain (as opposed to the Okta URL) is present will "APP_GROUP" type of groups be synchronized.
You must also make sure to include all domains that you use in the Domains setting (comma separated list, no whitespace).
The null reference error is likely caused by data mismatch between the group attributes - the "name" attribute of the group in Okta and the attribute set in the " Group Name Attribute " setting of the M-Files plugin may not match.
Solution
There are several things to check and consider.
Enable logging
Set the "Use Advanced Logging" setting of the plugin to "Yes" and monitor the Windows Event Log to see what number of groups come in from Okta, and what filters are used. This will also show you how may groups are returned from Okta and how many remain to be imported in M-Files after the names are resolved, and any mappings from the settings are applied.
Include the actual domain(s)
Make sure that your real domain is included in the "Domains" setting of the plugin. Without the actual domain, only the internal Okta groups will synchronize. For example, if the domain you are joined to is called "myDomain", and you have a second domain called "myOtherDomain" and your Okta URL is "https://myCompany.okta.com", set Domains to "myDomain,myOtherDomain". This will bring in the built-in Okta groups from myCompany.okta.com, and also the groups from the two domains that are available in that Okta tenant.
Group names must match
Ensure that external groups have the "windowsDomainQualifiedName" attribute set to the actual name of the group. If the group name is in a different attribute, set that attribute to the "Group Name Attribute" setting of the plugin. Ensure that this attribute also has the domain name.
For example, the group could look like this and it would cause an issue:
{
"name" : "groupName",
"windowsDomainQualifiedName" : "domain\someOtherName", // causes the issue as it does not match "name"
"properFixedName": "domain\groupName" // point the "Group Name Attribute" to that attribute and make sure it matches the "name" attribute
}
Improvement with ID 163108 makes it possible for M-Files to use the "name" (instead of "windowsDomainQualifiedName") and will resolve that null reference exception for situations when the "Group Name Attribute" does not match the "name" attribute. It will also resolve an issue where having more than one group match the chosen name may also throw this exception. This enhancement is available as of the 22.5 (May '22) release.
To have M-Files use the Okta group "Profile.Name" attribute as the name attribute of the group in M-Files, set the "Group Name Attribute" setting of the plugin in M-Files to "M-Files.Profile.Name" (without the quotes).
Group count
M-Files fetches the first 10 000 when you use the combo boxes to select groups. If you have more groups, consider typing the name of the group in the textbox below them.
You can reduce the "Maximum Number of Groups" setting to make the requests faster if populating the combo boxes is too slow.
Notes
Okta may still ignore the max groups limit, per an extract from their documentation on group limits:
- "The maximum value for limit is 200 for most orgs." - we already set a default of 10000 which is also listed as the default in their API reference at the time of writing.
- "Don't write code that depends on the default or maximum value, as it may change." - indicates that the server may have its own internal limits that may override the request parameter and take precedence.
So, you may also want to monitor the release notes for improvement with ID 154104 that will make the combo boxes filterable so that you can start typing the group name which will reduce the number of matches.
Improvement with ID 163112 will allow you to fetch more than 10 000 groups at one go (note that this may make the request very slow).
