[midPoint] Script expression in mapping & LDAP baseContext

Roman Pudil roman.pudil at ami.cz
Thu Nov 2 14:08:53 CET 2023


Hi Philippe,
try this:
basic.getResourceIcfConfigurationPropertyValue(resource, 'baseContext');

Docs:
https://download.evolveum.com/midpoint/4.8/midpoint-4.8-javadoc/com/evolveum/midpoint/model/common/expression/functions/BasicExpressionFunctions.html#getResourceIcfConfigurationPropertyValue(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType,java.lang.String)

Regards

Roman Pudil
solution architect

gsm: [+420] 775 663 666
e‑mail: roman.pudil at ami.cz<mailto:roman.pudil at ami.cz>

AMI Praha a.s.
Pernerova 697/35, 186 00 Praha 8

recepce: [+420] 604 444 848 | web: www.ami.cz<https://www.ami.cz/>

[AMI Praha a.s.]

Textem tohoto e‑mailu podepisující neslibuje uzavřít ani neuzavírá za společnost AMI Praha a.s.
jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena, musí mít výhradně písemnou formu.

Tento e‑mail je určen výhradně pro potřeby jeho adresáta/ů a může obsahovat důvěrné nebo osobní
informace. Nejste‑li zamýšleným příjemcem, je zakázáno jakékoliv zveřejňování, zprostředkování
nebo jiné použití těchto informací. Pokud jste obdrželi e‑mail neoprávněně, informujte o tom prosím
odesílatele a vymažte neprodleně všechny kopie tohoto e‑mailu včetně všech jeho příloh. Nakládáním
s neoprávněně získanými informacemi se vystavujete riziku právního postihu.


------ Původní zpráva ------
Od "Gustavo J Gallardo via midPoint" <midpoint at lists.evolveum.com<mailto:midpoint at lists.evolveum.com>>
Komu "philippebriffod at laposte.net<mailto:philippebriffod at laposte.net>" <philippebriffod at laposte.net<mailto:philippebriffod at laposte.net>>; "midPoint General Discussion" <midpoint at lists.evolveum.com<mailto:midpoint at lists.evolveum.com>>
Kopie "Gustavo J Gallardo" <ggallard at identicum.com<mailto:ggallard at identicum.com>>
Datum 02.11.2023 13:48:54
Předmět Re: [midPoint] Script expression in mapping & LDAP baseContext

Hi Philippe,
I think the right syntax would be:

<expression>
<script>
<code>'cn=' + employeeNumber + ',OU=Users,' + $resource/connectorConfiguration/configurationProperties/baseContext</code>
</script>
</expression>


Regards,

Gustavo

On Thu, Nov 2, 2023 at 8:26 AM Philippe via midPoint <midpoint at lists.evolveum.com<mailto:midpoint at lists.evolveum.com>> wrote:
‌Hello,

when configuring an LDAP resource we enter an LDAP DN in the parameter "baseContext"
    <connectorConfiguration >
        <icfc:configurationProperties >
...
            <gen629:baseContext>O=app21</gen629:baseContext>
...
        </icfc:configurationProperties>
    </connectorConfiguration>

when defining the mapping of the account, I would like to reuse this information for building the DN of the account

    <attribute id="9">
                <ref>ri:dn</ref>
                <outbound>
                    <strength>strong</strength>
                    <source>
                        <path>$focus/employeeNumber</path>
                    </source>
                    <expression>
                        <script>
                            <code>'cn=' + employeeNumber + ',OU=Users,' + resource.getBaseContext()</code>
                        </script>
                    </expression>
                </outbound>
    </attribute>

what is the correct expression to get the "baseContext" attribute of the resource ?

Thanks in advance
Philippe
_______________________________________________
midPoint mailing list
midPoint at lists.evolveum.com<mailto:midPoint at lists.evolveum.com>
https://lists.evolveum.com/mailman/listinfo/midpoint
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20231102/dab4e8de/attachment-0001.htm>


More information about the midPoint mailing list