As mentioned previously by others in this discussion, the combination of application, object type and value should be unique. Should, as theoretically it may not be, but it’s very unlikely to happen. The ManagedAttributer
will log a warning on the get
operations that find multiple instances matching the same criteria, but will eventually just return one.
Just to be clear object type is the name of the schema, not the fact that it is an Entitlement. An application can have multiple types of entitlements (group types, or non-group types).
Looking at a ManagedAttribute
, these are the attributes that we should look for. Well, first, let’s look at an XML representation of such an object:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE ManagedAttribute PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<ManagedAttribute aggregated="true" attribute="groups" created="1718705560820" displayName="Users" hash="087984d44823bdc1c9e677262184385c292c486a" id="ac10042990261d1381902ad59cf41195" lastRefresh="1718785322074" modified="1718785322084" requestable="true" type="group" value="cn=Users,ou=groups,dc=training,dc=sailpoint,dc=com">
<ApplicationRef>
<Reference class="sailpoint.object.Application" id="c0a8c89c706916e3817069d7a20c02fe" name="389DS"/>
</ApplicationRef>
<Attributes>
<Map>
<entry key="cn" value="Users"/>
<entry key="owner" value="cn=training.admin,ou=special,dc=training,dc=sailpoint,dc=com"/>
<entry key="sysDescriptions"/>
</Map>
</Attributes>
</ManagedAttribute>
In the header we see (among others) the following interesting attributes:
attribute
: this is the attribute that it corresponds to on the account schema.
displayName
: the value that you would see in most places in the UI, but not so interesting for our search as it may not be guaranteed to be unique.
type
: this is the object type or schema name that we should use for searching.
value
: the technical, unique value per application, per schema type.
(Note: often, the type
and attribute
are the same, but not always. This could lead to confusion.)
So, we found the first two necessary attributes: type
and value
. The third part of our puzzle is the application, which has a “hard link”, which we can reference as an application, the application name or id. In case of the ManagedAttributer
, we can either use the full Application
object or its id value to search for an object.
As an example, let’s say I have the id of an IdentityEntitlement
object and need to find the corresponding ManagedAttribute
, this is what I can do:
IdentityEntitlement ie = context.getObjectById(IdentityEntitlement.class, id);
if (ie != null) {
ManagedAttribute ma = ManagedAttributer.get(context,
ie.getApplication(),
ie.getName(),
Util.otos(ie.getValue())
);
if (ma != null) {
System.out.println(ma.toXml());
}
}
I hope this helps…
– Menno