[midPoint] Email Notification

Roman Pudil - AMI Praha a.s. roman.pudil at ami.cz
Fri Oct 31 16:33:45 CET 2014


Hi Jason,
problem is in syntax - remove the "semicolon" behind 
midpoint.getPlaintextUserPassword(requestee).

Regards
Roman Pudil

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.
Pláničkova 11
162 00 Praha 6
tel./fax: [+420] 274 783 239
web: www.ami.cz <http://www.ami.cz>

			

AMI Praha a.s.


<http://www.ami.cz/reseni-a-sluzby/bezpecnost-dat/identity-management>

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.

Dne 31.10.2014 v 14:40 Jason Everling napsal(a):
> Thanks for the information,
>
> The one he had given me does not work, it errors out
>
> So this does NOT work
>
> "Your Student ID is " + requestee?.getEmployeeNumber() + " \n\n" +
> "Your Username is " + requestee?.getName()?.getOrig() + " \n\n" +
> "Your Password is " + midpoint.getPlaintextUserPassword(requestee); + 
> " \n\n" +
>
> But if I remove the password like in the below, it works, so it is the 
> password code,
>
> "Your Student ID is " + requestee?.getEmployeeNumber() + " \n\n" +
> "Your Username is " + requestee?.getName()?.getOrig() + " \n\n" +
>
> Is there anything else in the password string that is incorrect?
>
> JASON
>
>
> On Fri, Oct 31, 2014 at 6:01 AM, Ivan Noris <Ivan.Noris at evolveum.com 
> <mailto:Ivan.Noris at evolveum.com>> wrote:
>
>     Hi Jason,
>
>     first please see the wiki page referenced by Roman in previous
>     e-mail
>     (https://wiki.evolveum.com/display/midPoint/Script+Expression+Functions).
>     This is handy also for other usages.
>
>     Back to notifications. I've just hacked my notifications like this
>     to show you how to access user's properties:
>
>           <handler>
>              <simpleUserNotifier>
>                 <recipientExpression>
>     <value>vix at localhost</value>
>                 </recipientExpression>
>                 <subjectExpression>
>                    <script>
>                       <code>
>     if (event.isSuccess())
>         tmpText = "[IDM] SUCCESS: User " + event.getChangeType() + "
>     operation succeeded for "
>     else if (event.isFailure())
>         tmpText = "[IDM] ERROR: User " + event.getChangeType() + "
>     operation failed for "
>     else  tmpText = "[IDM] IN PROGRESS: User " + event.getChangeType()
>     + " operation in progress for "
>
>     tmpText + requestee?.getName()?.getOrig() + ', family= ' +
>     requestee?.getFamilyName()?.getOrig() + ', employee number= ' +
>     requestee?.getEmployeeNumber() + ', property employeeNumber= ' +
>     basic.getPropertyValue(requestee, 'employeeNumber')
>     </code>
>                    </script>
>                 </subjectExpression>
>                 <transport>mail</transport>
>              </simpleUserNotifier>
>           </handler>
>
>     Subject in e-mail became:
>
>     Subject: [IDM] SUCCESS: User ADD operation succeeded for bbbbb,
>         family= Rimmer, employee number= 12123434,
>         property employeeNumber= 12123434
>
>     For standard polystring attributes, you may use simple
>     requestee?.getFamilyName()?.getOrig()
>     For standard string attributes, you may use simple
>     requestee?.getEmployeeNumber()
>
>     Please see our Common Schema to see which attribute is Polystring.
>
>     Or you can use Basic library's basic.getPropertyValue(requestee,
>     'employeeNumber').
>
>     To access the extended attributes, you need to use Basic library
>     (basic.getExtensionPropertyValue(...))
>
>     I have already added such examples to our
>     https://wiki.evolveum.com/display/midPoint/Notifications page earlier.
>
>     Regards,
>     Ivan
>
>
>     ------------------------------------------------------------------------
>
>         *From: *"Jason Everling" <jeverling at bshp.edu
>         <mailto:jeverling at bshp.edu>>
>         *To: *"midPoint General Discussion"
>         <midpoint at lists.evolveum.com <mailto:midpoint at lists.evolveum.com>>
>         *Sent: *Thursday, October 30, 2014 7:39:01 PM
>         *Subject: *Re: [midPoint] Email Notification
>
>
>         I got this down, I had to figure out where and what these were
>         for \n\n but I was able to add a ton of information that was
>         needed.
>
>         I need to add in the password and Employee Number which is
>         actually the student ID,
>
>         Is this correct, I couldn't find much on the subject,
>
>         Your Password is " + requestee?.getPassword()?.getOrig()
>         Your Student ID is " + requestee?.getEmployeeNumber()?.getOrig()
>
>         Thanks for all your help!
>
>         On Wed, Oct 29, 2014 at 3:07 PM, Jason Everling
>         <jeverling at bshp.edu <mailto:jeverling at bshp.edu>> wrote:
>
>             Ohh I see, Thanks!
>
>             JASON
>
>             On Wed, Oct 29, 2014 at 3:01 PM, Ivan Noris
>             <ivan.noris at evolveum.com <mailto:ivan.noris at evolveum.com>>
>             wrote:
>
>                 Hi Jason,
>
>                 On 10/29/2014 07:26 PM, Jason Everling wrote:
>
>                     Not that one, that one works just fine but if I
>                     try to add to it is when it fails, like
>
>                     <bodyExpression>
>                           <script>
>                                 <code>
>                                      Welome to blah blah, the
>                     following below are links to the various resources
>                     you will use here
>                           Your Username is  +
>                     requestee?.getName()?.getOrig()
>
>                                        You should login and should
>                     your password at http://www.example/com
>
>                                        Link 1
>                                        Link 2
>                                        Link 3
>                                </code>
>                             </script>
>                     </bodyExpression>
>
>                 I see. But the answer is very simple: everything in
>                 <code> is a groovy expression. Return value of this
>                 expression is what will be used for e-mail body (in
>                 this case).
>
>                 For example in my previous sample, the Groovy
>                 expression "[IDM] Your username is: " +
>                 requestee?.getName()?.getOrig() is actually the same as:
>
>                 return *"*[IDM] Your username is: *"* *+*
>                 requestee?.getName()?.getOrig()
>
>                 In your case, you are missing:
>                 1) quotes for strings
>                 2) + operator for concatenating strings
>
>                 So your example needs to be rewritten to maintain your
>                 required formatting, as:
>
>                 <bodyExpression>
>                                <script>
>                                   <code>
>                                    "Welome to blah blah, the following
>                 below are links to the various resources you will use
>                 here. \n" + "Your Username is " +
>                 requestee?.getName()?.getOrig() + "\nYou should login
>                 and should your password at http://www.example/com"
>                              </code>
>                                </script>
>                 </bodyExpression>
>
>                 (this is a copy/paste from actual System Configuration)
>
>                 Which will produce notification for example:
>
>                 Welome to blah blah, the following below are links to
>                 the various resources
>                 you will use here.
>                 Your Username is hulahop
>                 You should login and should your password at
>                 http://www.example/com
>
>                 (this is copy/paste from actual e-mail that was sent).
>
>                 So now you should be able to do anything (except the
>                 HTML discussed earlier).
>
>                 Regards,
>                 Ivan
>
>                     On Wed, Oct 29, 2014 at 1:18 PM, Ivan Noris
>                     <ivan.noris at evolveum.com
>                     <mailto:ivan.noris at evolveum.com>> wrote:
>
>                         Hi Jason,
>
>                         so the following didn't work for you? It looks
>                         ok at the first look.
>
>                         Do you get any exception when sending
>                         notifications? Errors in log? What precisely
>                         "does not work"? I'll try to replicate the
>                         behaviour. But please send the whole
>                         notification handler which does not work.
>                         Thank you.
>
>                             <bodyExpression>
>                             <script>
>                             <code>
>                             "[IDM] Your username is: " +
>                             requestee?.getName()?.getOrig()
>                             </code>
>                             </script>
>                             </bodyExpression>
>
>
>                         Regards,
>                         Ivan
>
>                         -- 
>                            Ing. Ivan Noris
>                            Senior Identity Management Engineer
>                            evolveum.com  <http://evolveum.com>
>                            ___________________________________________
>                                     "Idem per idem - semper idem Vix."
>
>
>                         _______________________________________________
>                         midPoint mailing list
>                         midPoint at lists.evolveum.com
>                         <mailto:midPoint at lists.evolveum.com>
>                         http://lists.evolveum.com/mailman/listinfo/midpoint
>
>
>
>
>
>                     CONFIDENTIALITY NOTICE:
>                     This e-mail together with any attachments is
>                     proprietary and confidential; intended for only
>                     the recipient(s) named above and may contain
>                     information that is privileged. You should not
>                     retain, copy or use this e-mail or any attachments
>                     for any purpose, or disclose all or any part of
>                     the contents to any person. Any views or opinions
>                     expressed in this e-mail are those of the author
>                     and do not represent those of the Baptist School
>                     of Health Professions. If you have received this
>                     e-mail in error, or are not the named
>                     recipient(s), you are hereby notified that any
>                     review, dissemination, distribution or copying of
>                     this communication is prohibited by the sender and
>                     to do so might constitute a violation of the
>                     Electronic Communications Privacy Act, 18 U.S.C.
>                     section 2510-2521. Please immediately notify the
>                     sender and delete this e-mail and any attachments
>                     from your computer.
>
>
>                     _______________________________________________
>                     midPoint mailing list
>                     midPoint at lists.evolveum.com  <mailto:midPoint at lists.evolveum.com>
>                     http://lists.evolveum.com/mailman/listinfo/midpoint
>
>
>                 -- 
>                    Ing. Ivan Noris
>                    Senior Identity Management Engineer
>                    evolveum.com  <http://evolveum.com>
>                    ___________________________________________
>                             "Idem per idem - semper idem Vix."
>
>
>                 _______________________________________________
>                 midPoint mailing list
>                 midPoint at lists.evolveum.com
>                 <mailto:midPoint at lists.evolveum.com>
>                 http://lists.evolveum.com/mailman/listinfo/midpoint
>
>
>
>
>
>
>         CONFIDENTIALITY NOTICE:
>         This e-mail together with any attachments is proprietary and
>         confidential; intended for only the recipient(s) named above
>         and may contain information that is privileged. You should not
>         retain, copy or use this e-mail or any attachments for any
>         purpose, or disclose all or any part of the contents to any
>         person. Any views or opinions expressed in this e-mail are
>         those of the author and do not represent those of the Baptist
>         School of Health Professions. If you have received this e-mail
>         in error, or are not the named recipient(s), you are hereby
>         notified that any review, dissemination, distribution or
>         copying of this communication is prohibited by the sender and
>         to do so might constitute a violation of the Electronic
>         Communications Privacy Act, 18 U.S.C. section 2510-2521.
>         Please immediately notify the sender and delete this e-mail
>         and any attachments from your computer.
>
>         _______________________________________________
>         midPoint mailing list
>         midPoint at lists.evolveum.com <mailto:midPoint at lists.evolveum.com>
>         http://lists.evolveum.com/mailman/listinfo/midpoint
>
>
>
>
>     -- 
>       Ing. Ivan Noris
>       Senior Identity Management Engineer
>     evolveum.com <http://evolveum.com>
>       ___________________________________________
>                "Idem per idem - semper idem Vix."
>
>     _______________________________________________
>     midPoint mailing list
>     midPoint at lists.evolveum.com <mailto:midPoint at lists.evolveum.com>
>     http://lists.evolveum.com/mailman/listinfo/midpoint
>
>
>
>
>
> CONFIDENTIALITY NOTICE:
> This e-mail together with any attachments is proprietary and 
> confidential; intended for only the recipient(s) named above and may 
> contain information that is privileged. You should not retain, copy or 
> use this e-mail or any attachments for any purpose, or disclose all or 
> any part of the contents to any person. Any views or opinions 
> expressed in this e-mail are those of the author and do not represent 
> those of the Baptist School of Health Professions. If you have 
> received this e-mail in error, or are not the named recipient(s), you 
> are hereby notified that any review, dissemination, distribution or 
> copying of this communication is prohibited by the sender and to do so 
> might constitute a violation of the Electronic Communications Privacy 
> Act, 18 U.S.C. section 2510-2521. Please immediately notify the sender 
> and delete this e-mail and any attachments from your computer.
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20141031/a4edce82/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ami_logo.gif
Type: image/gif
Size: 2900 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20141031/a4edce82/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AMI-podpis-IdM_1.png
Type: image/png
Size: 21628 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20141031/a4edce82/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3924 bytes
Desc: Elektronicky podpis S/MIME
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20141031/a4edce82/attachment.bin>


More information about the midPoint mailing list