<p dir="ltr">Hi,</p>
<p dir="ltr">I think I&#39;m in the right track now. I&#39;m being able to call the webservice before commit. However, when the user is sucessfully created by the webservice, I need to update my local user to add a property with the external user id. How can I do that in the same transaction?<br>
I&#39;m trying to set the property on the managed delegate user model, but it has no effect.</p>
<p dir="ltr">Thank you!</p>
<div class="gmail_quote">On 9 Dec 2015 18:39, &quot;Marek Posolda&quot; &lt;<a href="mailto:mposolda@redhat.com">mposolda@redhat.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div>On 09/12/15 19:33, Jorge M. wrote:<br>
    </div>
    <blockquote type="cite">
      <p dir="ltr">I&#39;m developing a custom federation that communicates
        with my user repository via webservices. <br>
        Probably this is a very strange scenario for a federation but
        that&#39;s the unique way that I have to communicate with the
        repository.</p>
      <p dir="ltr">My problem is that, as the webservices only exposes
        methods such as createUser and updateUser, I&#39;m having problems
        with registrations and user profile updates because I&#39;m not
        being able to do atomic calls to the webservice methods, with
        all the information that I need.</p>
      <p dir="ltr">As far as I know, from the properties file example
        and from the ldap federation source (probably I&#39;m missing
        something) it seems that the federation api is intended to
        update and sync attribute by attribute (Keycloak &lt;-&gt;
        Federation). <br>
        Am i wrong? Do you suggest another approach? Should I give up
        from having a federation that uses a webservice?</p>
    </blockquote>
    You can use &quot;transaction wrapper&quot;, which will allow you to store all
    the updates to user locally, but send the UPDATE request to your
    webservice later at transaction commit time. You may need to create
    custom transaction and enlist it with Keycloak TransactionManager. <br>
    <br>
    This is what we have for LDAP federation provider right now. See <span style="background-color:#e4e4ff">TxAwareLDAPUserModelDelegate.</span>
    
    <br>
    <br>
    Marek<br>
    <blockquote type="cite">
      <p dir="ltr">Thank you.</p>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
keycloak-dev mailing list
<a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a></pre>
    </blockquote>
    <br>
  </div>

</blockquote></div>