[midPoint] Outbound mapping PostgresDB

Ivan Noris ivan.noris at evolveum.com
Thu Jan 23 12:27:57 CET 2020


Hi Elsa,

my thoughts:

1. keyColumn is incorrectly set to "id". That's a number. It should be
set to "username". Then it should not complain anymore.

2. AFAIK DBTable connector does not support two identifiers. icfs:uid
will be always returned the same value as icfs:name. This is one of the
oldest connectors (from OpenICF/ICF)

3. you need to only use icfs:name in the schema handling. Do not use
ri:username mapping.

That should help.

If you need two identifiers, you have two options:

a) use ScriptedSQL connector, or

b) endorse https://jira.evolveum.com/browse/MID-2265 (DatabaseTable
connector rewrite) using your/your client subscription.

Best regards,

Ivan

On 23. 1. 2020 12:19, Gómez Martínez, Elsa wrote:
>
> Sorry, I forgot to attach the file.
>
>  
>
> Elsa
>
> *De:*Gómez Martínez, Elsa
> *Enviado el:* jueves, 23 de enero de 2020 12:19
> *Para:* midPoint General Discussion <midpoint at lists.evolveum.com>
> *Asunto:* RE: [midPoint] Outbound mapping PostgresDB
>
>  
>
>  
>
> Hi Ivan,
>
>  
>
> This is the resource schema for icfs:name and username
>
>  
>
>                         <xsd:elementminOccurs=/"0"/ name=/"username"/
> type=/"xsd:string"/>
>
>                             <xsd:annotation>
>
>                                 <xsd:appinfo>
>
>                                     <a:displayOrder>130</a:displayOrder>
>
>                                    
> <ra:frameworkAttributeName>_username_</ra:frameworkAttributeName>
>
>                                 </xsd:appinfo>
>
>                             </xsd:annotation>
>
>                         </xsd:element>
>
>                         <xsd:elementref=/"icfs:name"/>
>
>                             <xsd:annotation>
>
>                                 <xsd:appinfo>
>
>                                     <a:displayName>ConnId
> Name</a:displayName>
>
>                                     <a:displayOrder>110</a:displayOrder>
>
>                                    
> <ra:frameworkAttributeName>__NAME__</ra:frameworkAttributeName>
>
>                                 </xsd:appinfo>
>
>                             </xsd:annotation>
>
>                         </xsd:element>
>
>  
>
> I add the complete resource XML file. I have made some changes to hide
> some critical information.
>
>  
>
> Regards,
>
> Elsa
>
> *De:*midPoint <midpoint-bounces at lists.evolveum.com
> <mailto:midpoint-bounces at lists.evolveum.com>> *En nombre de *Ivan Noris
> *Enviado el:* jueves, 23 de enero de 2020 12:11
> *Para:* midpoint at lists.evolveum.com <mailto:midpoint at lists.evolveum.com>
> *Asunto:* Re: [midPoint] Outbound mapping PostgresDB
>
>  
>
> Hi Elsa,
>
> I'd recommend to check the resource schema. Namely, icfs:name and
> ri:username.
>
> From the log it looks like the format for the attribute where you put
> "alex" is Long.
>
> Also if you're using the DBTable connector and if "username" column is
> the primary key, you cannot use "ri:username" and "icfs:name" together.
>
> You have not sent the whole resource example, so I just guess that
> <keyColumn> is username in your configuration properties.
>
> Try to comment the mapping for ri:username and see if it helps. But if
> you check the configuration properties and schema (not schema
> handling), it should help.
>
> Disclaimer: I'm not using DBTable in any recent midpoint deployment.
> Someone from this list certainly does.
>
> Best regards,
>
> Ivan
>
> On 23. 1. 2020 11:42, Gómez Martínez, Elsa wrote:
>
>     Hi Ivan,
>
>      
>
>     I add the midPoint.log file with the error part from one simple test.
>
>      
>
>     Steps:
>
>     1.       Create user “alex” from MidPoint GUI
>
>     2.       Assign the resource _Localhost_PostgreSQL DBTable
>
>      
>
>     020-01-23 10:59:09,806 [] [pool-3-thread-5] ERROR
>     (com.evolveum.midpoint.web.component.progress.ProgressPanel):
>     Error executing changes.
>
>     com.evolveum.midpoint.util.exception.ConfigurationException:
>     Configuration error: For input string: "alex"
>
>             at
>     com.evolveum.midpoint.provisioning.ucf.impl.connid.ConnIdUtil.processConnIdException(ConnIdUtil.java:168)
>
>             at
>     com.evolveum.midpoint.provisioning.ucf.impl.connid.ConnIdUtil.processConnIdException(ConnIdUtil.java:94)
>
>             at
>     com.evolveum.midpoint.provisioning.ucf.impl.connid.ConnectorInstanceConnIdImpl.addObject(ConnectorInstanceConnIdImpl.java:869)
>
>             at
>     com.evolveum.midpoint.provisioning.impl.ResourceObjectConverter.addResourceObject(ResourceObjectConverter.java:266)
>
>             at
>     com.evolveum.midpoint.provisioning.impl.ShadowCache.addShadowAttempt(ShadowCache.java:554)
>
>             at
>     com.evolveum.midpoint.provisioning.impl.ShadowCache.addShadow(ShadowCache.java:496)
>
>             at
>     com.evolveum.midpoint.provisioning.impl.ProvisioningServiceImpl.addObject(ProvisioningServiceImpl.java:280)
>
>             at
>     com.evolveum.midpoint.model.impl.lens.ChangeExecutor.addProvisioningObject(ChangeExecutor.java:1580)
>
>             at
>     com.evolveum.midpoint.model.impl.lens.ChangeExecutor.executeAddition(ChangeExecutor.java:1362)
>
>             at
>     com.evolveum.midpoint.model.impl.lens.ChangeExecutor.executeDelta(ChangeExecutor.java:938)
>
>             at
>     com.evolveum.midpoint.model.impl.lens.ChangeExecutor.executeChanges(ChangeExecutor.java:326)
>
>             at
>     com.evolveum.midpoint.model.impl.lens.Clockwork.lambda$processSecondary$0(Clockwork.java:796)
>
>             at
>     com.evolveum.midpoint.model.impl.lens.ClockworkMedic.partialExecute(ClockworkMedic.java:211)
>
>             at
>     com.evolveum.midpoint.model.impl.lens.ClockworkMedic.partialExecute(ClockworkMedic.java:154)
>
>             at
>     com.evolveum.midpoint.model.impl.lens.Clockwork.processSecondary(Clockwork.java:794)
>
>             at
>     com.evolveum.midpoint.model.impl.lens.Clockwork.click(Clockwork.java:615)
>
>             at
>     com.evolveum.midpoint.model.impl.lens.Clockwork.run(Clockwork.java:200)
>
>             at
>     com.evolveum.midpoint.model.impl.controller.ModelController.executeChanges(ModelController.java:556)
>
>             at
>     com.evolveum.midpoint.web.component.progress.ProgressPanel$14.callWithContextPrepared(ProgressPanel.java:592)
>
>             at
>     com.evolveum.midpoint.web.component.progress.ProgressPanel$14.callWithContextPrepared(ProgressPanel.java:578)
>
>             at
>     com.evolveum.midpoint.web.component.SecurityContextAwareCallable.call(SecurityContextAwareCallable.java:50)
>
>             at
>     java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>
>             at
>     java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>
>             at
>     java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>
>             at java.base/java.lang.Thread.run(Thread.java:834)
>
>      
>
>     Regards,
>
>     Elsa
>
>      
>
>     *De:*midPoint <midpoint-bounces at lists.evolveum.com>
>     <mailto:midpoint-bounces at lists.evolveum.com> *En nombre de *Ivan Noris
>     *Enviado el:* jueves, 23 de enero de 2020 8:45
>     *Para:* midpoint at lists.evolveum.com
>     <mailto:midpoint at lists.evolveum.com>
>     *Asunto:* Re: [midPoint] Outbound mapping PostgresDB
>
>      
>
>     Hi Elsa,
>
>     can you please check midpoint.log? There should be something more.
>
>     Regards,
>
>     Ivan
>
>     On 22. 1. 2020 15:51, Gómez Martínez, Elsa wrote:
>
>         Hello!
>
>          
>
>         I am trying to mapping the users from MidPoint to a PostgreSQL
>         Database but I am having the next error:
>
>         *Save (GUI)*Configuration error: For input string: "superuserTest"
>
>          
>
>         Account (default) on Basic PostgreSQL DBTable
>
>         	
>         	
>
>         Add:Fatal error -> superuserTest
>
>          
>
>         I am using the next git sample:
>
>         https://github.com/Evolveum/midpoint-samples/blob/master/samples/resources/databasetable/postgresql/resource-dbtable-postgresql.xml
>
>          
>
>         And this is my schema handling configuration (my username is
>         my unique identifier):
>
>                 <schemaHandling>
>
>                     <objectTypeid=/"5"/>
>
>                         <displayName>Default Account</displayName>
>
>                         <default>true</default>
>
>                         <objectClass>ri:AccountObjectClass</objectClass>
>
>                         <attributeid=/"6"/>
>
>                             <c:ref>icfs:uid</c:ref>
>
>                             <displayName>User ID</displayName>
>
>                             <limitations>
>
>                                 <access>
>
>                                     <read>true</read>
>
>                                 </access>
>
>                             </limitations>
>
>                         </attribute>
>
>                         <attributeid=/"7"/>
>
>                             <c:ref>icfs:name</c:ref>
>
>                             <displayName>Name</displayName>
>
>                             <limitations>
>
>                                 <minOccurs>0</minOccurs>
>
>                                 <access>
>
>                                     <read>true</read>
>
>                                     <add>true</add>
>
>                                     <modify>true</modify>
>
>                                 </access>
>
>                             </limitations>
>
>                             <outbound>
>
>                                 <source>
>
>                                     <c:path>$user/name</c:path>
>
>                                 </source>
>
>                             </outbound>
>
>                         </attribute>
>
>                         <attributeid=/"4"/>
>
>                             <c:ref>ri:username</c:ref>
>
>                             <displayName>_Username_</displayName>
>
>                             <outbound>
>
>                                 <source>
>
>                                     <c:path>$user/name</c:path>
>
>                                 </source>
>
>                             </outbound>
>
>                         </attribute>
>
>          
>
>         And my database schema:
>
>          
>
>          
>
>         One example user:
>
>          
>
>          
>
>          
>
>          
>
>         Could anyone help me?
>
>          
>
>         Thanks a lot!
>
>          
>
>         minsait <http://www.minsait.com/>
>
>          
>
>         Elsa Gómez Martínez
>
>
>         Ciberseguridad
>
>          
>
>         Espacio Virtual:
>
>         https://join.indra.es <https://join.indra.es/>
>
>         egomezm at cms.indra.es <mailto:egomezm at cms.indra.es>
>
>         ID: 269068
>
>         https://emailingindra.indra.es/archivos/1/12316_mates-firma-interna.png
>         <https://apps.indraweb.net/mates?utm_source=Notificacion-Mates&utm_medium=email&utm_content=Firma&utm_campaign=Firma-interna&recognise-direct=egomezm>
>
>          
>
>          
>
>
>
>         _______________________________________________
>
>         midPoint mailing list
>
>         midPoint at lists.evolveum.com <mailto:midPoint at lists.evolveum.com>
>
>         http://lists.evolveum.com/mailman/listinfo/midpoint
>
>     -- 
>
>     Ivan Noris
>
>     Senior Identity Engineer
>
>     evolveum.com
>
>      
>
>     _______________________________________________
>
>     midPoint mailing list
>
>     midPoint at lists.evolveum.com <mailto:midPoint at lists.evolveum.com>
>
>     http://lists.evolveum.com/mailman/listinfo/midpoint
>
> -- 
> Ivan Noris
> Senior Identity Engineer
> evolveum.com
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint

-- 
Ivan Noris
Senior Identity Engineer
evolveum.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20200123/e3cf831d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 54881 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20200123/e3cf831d/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 8943 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20200123/e3cf831d/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 3646 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20200123/e3cf831d/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 2554 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20200123/e3cf831d/attachment-0003.png>


More information about the midPoint mailing list