Translations: English
Search on Docs:
ActionItem Search:

#1567: Synchronize Noosfero user base with other applications

Type: FeatureItem Feature: Email, Infrastructure Tags: zen3
ScheduledFor:   Assigned to:   Sites:  
Priority: 0 Status: Pending  

Sometimes youl'l want to integrate Noosfero with other applications, in the sense that you want to let your users use other services with the same username and password they use to login on Noosfero. To do that, Noosfero must communicate with the target system in the following moments:

Noosfero event Needed action
User account created Tell the auxiliar application to create a similar user record
User account updated Tell the auxiliar application to update the user account accordingly
Password changed Tell the auxiliar application to change the password accordingly

To do that the proposal is:

  1. create hooks for those events in the User and Person classes
  2. those hooks will call external programs (with Ruby's system method) configured by the local administrator in config/user_hooks.yml
  3. the local administrator will configure command lines to be used in those hooks using formatting strings

Example of config/user_hooks.yml:

   create: /path/to/createuserprg --username %{login} --password %{password} --fullname %{name}
   update: /path/to/updateuserprg --username %{login} 
   password_changed: /path/to/changepwd --username %{login} --password %{password}
   find: /path/to/listusersprg  | grep %{login}

All attributes from User and Person classes must be available for those hooks.

The attribute values will be interpolated in the command lines already escaped so that the local administrator does not need to worry about arbitrary code execution, e.g.:

Attribute string passed to the shell
John Doe 'John Doe'
; cat /etc/passwd '; cat /etc/passwd'
$(cat /etc/passwd) '$(cat /etc/passwd)'
`cat /etc/passwd` '`cat /etc/passwd`'

(the escape library is already in Debian)

The special find command line will be used by Noosfero to check whether the user was properly inserted into the external database upon account creation. It must end with a 0 exit code, otherwise Noosfero will abort the user creation.

-- AntonioTerceiro - 18 Jun 2010
Add comment
You need to login to be able to comment.

ActionItemForm edit

Title Synchronize Noosfero user base with other applications
ActionItemType FeatureItem
Priority Low
Tags zen3
Feature Email, Infrastructure
Status Pending
Ticket SAC:
Topic revision: r1 - 22 May 2015, UnknownUser

irc Talk with Devs Now!

Copyright © 2007-2019 by the Noosfero contributors
Colivre - Cooperativa de Tecnologias Livres