[midPoint] mapping securityQuestions

Radovan Semancik radovan.semancik at evolveum.com
Thu Oct 13 10:10:26 CEST 2016


Hi,

What you are doing should work. Theoretically. But you are probably the 
first one that have tried something like that in practice.
Looking at the schema it seems that you have got the path and the data 
types right. Try to enable mapping and expression tracing. Please see
https://wiki.evolveum.com/display/midPoint/Troubleshooting+Mappings
I have just added a couple of new sections about expression tracing. The 
trace may give you more information on what's wrong. If it still won't 
make any sense to you, please select the relevant parts of the logs and 
send them to me. I'll have a look.

-- 
Radovan Semancik
Software Architect
evolveum.com



On 10/12/2016 05:13 PM, Oskar Butovič - AMI Praha a.s. wrote:
> 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 <mailto: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 <http://www.ami.cz/>
>
> 			
>
> AMI Praha a.s.
>
>
> 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.
>
>
>
> _______________________________________________
> 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/20161013/d9cc4b23/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 38804 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20161013/d9cc4b23/attachment.png>


More information about the midPoint mailing list