cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco User Profile Sync with xternal application

sabinay
Champ in-the-making
Champ in-the-making
Hi,

We have one authentication subsystem outside of alfresco and once user is validated through that we system they are redirected to alfresco and we create the user in alfresco.
Our requirement is if user edit his profile like first name,last name, job profile etc then it has to be updated in alfresco as well as in the out side authentication sub system as well.
The outside authentication subsystem provides the web service for updating the profile,could you please let us know the best approach to achieve this.

I tried to call the web service from the js file like below but the connection is not established.
1) Create a endpoint in share config custom file:
    <endpoint>
     <id>my-endpoint</id>
     <connector-id>http</connector-id>
     <endpoint-url>my end point url</endpoint-url>
     <identity>user</identity>
    </endpoint>
2) In the js file tried to call the webscrvice
   
    var connector = remote.connect("my-endpoint");
    var result1 = connector.put("/api/url/",jsonUtils.toJSONString(paramsUpdate),
                               "application/json");
  
Let us know the best approach to achieve this.

Thanks,
Sabinay 
1 REPLY 1

steven_okennedy
Star Contributor
Star Contributor
Hi Sabinay,

Alfresco is split into two main applications, Alfresco (the repository) and Share (the user interface).  Generally it is better to try and keep that split doing only user interface extensions in Share and doing any custom business logic/content operations as Alfresco extensions. 

From your snippet above it would seem that you're looking at catching the event in Share and then trying to get Share to call your external service, which doesn't really meet this pattern.  Alfresco.war has generally nicer and more maintainable patterns for these types of extensions and can be made in a more maintainable/upgradable way.

There could be many ways to accomplish this but I would suggest that you look at using a Behaviour to capture the change and call the logic you want to from there.  You'll have access to call a HTTP client directly from the behaviour's code and should be a lot easier to debug and unit test.  You can see examples of how to create a behaviour here: http://ecmarchitect.com/alfresco-developer-series-tutorials/behaviors/tutorial/tutorial.html

Steven