Highlighted
Frequent Contributor.
Frequent Contributor.
153 views

IDM Generic Null Driver - Duplicate Email

Hi everyone, 

I have one driver here Generic Null, and i need to do some checking email address which is when a new user was create, the policy would triggered to check either email address exist or not. If exist, policy should create other unique email address.

Like, email address **PERSONAL INFORMATION REMOVED**  already exists for the user A, now the user B also have same email  **PERSONAL INFORMATION REMOVED**.  The policy should change email address for user B to **PERSONAL INFORMATION REMOVED** .

I tried, use unique name token, but for null driver nothing happen. I really appreciate if someone could help.

Thank you.

Labels (1)
0 Likes
3 Replies
Highlighted
Knowledge Partner
Knowledge Partner

Re: IDM Generic Null Driver - Duplicate Email

Use token-query to find all users using the mail address. If you do not find any, it Is not yet in use...
______________________________________________
https://www.is4it.de/identity-access-management
0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Re: IDM Generic Null Driver - Duplicate Email

Null driver cant use that token since it only query forward.
Change the null driver to loop back and it will work.

Or do your own query as Lothar suggest.
0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Re: IDM Generic Null Driver - Duplicate Email

I use null driver for generate unique email address (unique SMTP local part).

My code:
<rule>
<description>3-3 check-unique-local</description>
<conditions>
<and>
<if-op-attr name="Internet EMail Address" op="available"/>
<if-local-variable mode="nocase" name="lvRightClassBoolean" op="equal">TRUE</if-local-variable>
<if-local-variable mode="nocase" name="lvNew-local" op="not-equal"/>
</and>
</conditions>
<actions>
<do-if>
<arg-conditions>
<and>
<if-global-variable mode="nocase" name="gcvDebug" op="equal">true</if-global-variable>
</and>
</arg-conditions>
<arg-actions>
<do-trace-message color="brcyan">
<arg-string>
<token-text xml:space="preserve">3-3 check-unique-local</token-text>
</arg-string>
</do-trace-message>
</arg-actions>
<arg-actions/>
</do-if>
<do-set-local-variable name="lvLocalSMTPdn" scope="policy">
<arg-node-set>
<token-query datastore="src">
<arg-dn>
<token-global-variable name="gcvRoot"/>
</arg-dn>
<arg-match-attr name="O:localSMTP">
<arg-value type="string">
<token-local-variable name="lvNew-local"/>
</arg-value>
</arg-match-attr>
<arg-string>
<token-text xml:space="preserve">cn</token-text>
</arg-string>
</token-query>
</arg-node-set>
</do-set-local-variable>
<do-set-local-variable name="lvLocalSMTPCounter" scope="policy">
<arg-string>
<token-xpath expression="count($lvLocalSMTPdn)"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="lvLocalSMTPUniqueBoolean" scope="policy">
<arg-string>
<token-xpath expression="boolean($lvLocalSMTPCounter=0)"/>
</arg-string>
</do-set-local-variable>
<do-if>
<arg-conditions>
<and>
<if-local-variable mode="nocase" name="lvLocalSMTPCounter" op="equal">1</if-local-variable>
</and>
</arg-conditions>
<arg-actions>
<do-set-local-variable name="lvSameSMTPObjectDN" scope="policy">
<arg-string>
<token-upper-case>
<token-xpath expression="$lvLocalSMTPdn/@src-dn"/>
</token-upper-case>
</arg-string>
</do-set-local-variable>
<do-if>
<arg-conditions>
<and>
<if-local-variable mode="nocase" name="dest-dn" op="equal">$lvSameSMTPObjectDN$</if-local-variable>
</and>
</arg-conditions>
<arg-actions>
<do-set-local-variable name="lvLocalSMTPUniqueBoolean" scope="policy">
<arg-string>
<token-text xml:space="preserve">true</token-text>
</arg-string>
</do-set-local-variable>
</arg-actions>
<arg-actions>
<do-set-local-variable name="lvLocalSMTPUniqueBoolean" scope="policy">
<arg-string>
<token-text xml:space="preserve">false</token-text>
</arg-string>
</do-set-local-variable>
</arg-actions>
</do-if>
</arg-actions>
<arg-actions/>
</do-if>
<do-set-local-variable name="lvRestorePreviousSMTP" scope="policy">
<arg-string>
<token-xpath expression='($lvLocalSMTPUniqueBoolean="false")'/>
</arg-string>
</do-set-local-variable>
</actions>
</rule>

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.