[midPoint] Midpoint Query API and Extension Attributes

Ivan Noris ivan.noris at evolveum.com
Tue Jul 13 16:13:11 CEST 2021


Hi Jeremiah,

if you already have user object, you can use 
basic.getExtensionPropertyValue / basic.getExtensionPropertyValues 
function as in:

basic.getExtensionPropertyValue(thisUser, "http://example.com/midpoint", 
"empStatus")

In this example, "empStatus" is my extension attribute and 
"http://example.com/midpoint" is my extension schema namespace.

See also 
https://docs.evolveum.com/midpoint/reference/expressions/expressions/script/functions/#basic-library

Hope this helps.

Best regards,

Ivan

On 13. 7. 2021 15:57, Haywood, Jeremiah via midPoint wrote:
>
> Has anyone worked with the Midpoint query api and returning extension 
> attribute values for users? It seems the default schema attributes can 
> be accessed by name fairly easily. Have been looking at the UserType 
> (https://download.evolveum.com/midpoint/4.2/midpoint-4.2-javadoc/com/evolveum/midpoint/xml/ns/_public/common/common_3/UserType.html 
> <https://download.evolveum.com/midpoint/4.2/midpoint-4.2-javadoc/com/evolveum/midpoint/xml/ns/_public/common/common_3/UserType.html>) 
> class but can't seem to find a method to directly access the extension 
> attributes. Was hoping there wouldn’t be a need for regex.
>
> Example:
>
> // query for user
>
> thisUser = midpoint.searchObjects(UserType.class, userQuery, null)
>
> // returns value for givenName
>
> thisUser.givenName
>
> //returns an arraylist, with additional unwanted info
>
> thisUser.extension
>
> e.g.
>
> [PCV(null):[PP({http://customSchema.com/xml/ns/customSchema}preferredFirstName):[PPV(String:Luke)]]
>
> Thank you,
>
> Jeremiah Haywood
>
> Identity and Access Management Administrator
>
> Office of Technology Solutions | Illinois State University
>
> Phone Number (309) 438-3829
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> https://lists.evolveum.com/mailman/listinfo/midpoint

-- 
Ivan Noris
Senior Identity Engineer
evolveum.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20210713/c2bb9fd5/attachment-0001.htm>


More information about the midPoint mailing list