[midPoint] mapping securityQuestions

Oskar Butovič - AMI Praha a.s. oskar.butovic at ami.cz
Wed Oct 12 17:13:43 CEST 2016


Hello everybody

I am trying to prefill one security question for users. Whenever I set
questionAnswer text it tries to add two whole questionAnswer objects.
Despite being authoritative, strong and relativity-absolute it doesnt
delete any existing values and duplicate the one I am trying to add.
Interresting is that when I comment out line
"resultQuestion.setQuestionAnswer(answerText);" midpoint tries to add only
one question answer but it has no answer text obviously.

I want to create different answer for each user so I havent used simple
<value> as expression.
I am using this mapping:

<mapping>
      <name>start date question</name>
      <authoritative>true</authoritative>
      <strength>strong</strength>
      <expression>
         <script>
            <relativityMode>absolute</relativityMode>
            <code>
import
com.evolveum.midpoint.xml.ns._public.common.common_3.SecurityQuestionAnswerType;
import com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType;
import java.lang.reflect.*;
def resultQuestions = [];
SecurityQuestionAnswerType resultQuestion = new
SecurityQuestionAnswerType();
resultQuestion.setQuestionIdentifier("
http://midpoint.evolveum.com/xml/ns/public/security/question-2#q001");
ProtectedStringType answerText = basic.encrypt("2.2.2016");
resultQuestion.setQuestionAnswer(answerText);
resultQuestions << resultQuestion;
return resultQuestions;
            </code>
         </script>
      </expression>
      <target>
         <c:path>credentials/securityQuestions/questionAnswer</c:path>
      </target>
   </mapping>

this is result of preview:

​
Am I doing something wrong in mapping? Could security question answers be
prepared by some other way?

Best Regards

Oskar Butovič

-- 

Oskar Butovič
solution architect

gsm: [+420] 774 480 101
e-mail: oskar.butovic at ami.cz


AMI Praha a.s.
Pláničkova 11
162 00 Praha 6
tel.: [+420] 274 783 239
web: www.ami.cz


[image: AMI Praha a.s.]

[image: 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20161012/e46df184/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: preview.png
Type: image/png
Size: 38804 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20161012/e46df184/attachment.png>


More information about the midPoint mailing list