Sincronización LDAP sin 'cron'

cancel
Showing results for 
Search instead for 
Did you mean: 
rhakaro
Member II

Sincronización LDAP sin 'cron'

Hola a todos!

Tengo una pequeña duda técnica de rápida respuesta. Tenemos entre manos un sistema Alfresco (3.4.0) configurado para tirar de un LDAP que funciona correctamente.

Leyendo el fichero de configuración ldap-ad-authentication.properties veo estas propiedades:


# This flag enables use of this LDAP subsystem for authentication. It may be
# that this subsytem should only be used for synchronization, in which case
# this flag should be set to false.
ldap.authentication.active=true

#
# This properties file brings together the common options for LDAP authentication rather than editing the bean definitions
#
ldap.authentication.allowGuestLogin=false

# How to map the user id entered by the user to taht passed through to LDAP
# In Active Directory, this can either be the user principal name (UPN) or DN.
# UPNs are in the form <sAMAccountName>@domain and are held in the userPrincipalName attribute of a user
# ldap.authentication.userNameFormat=%s@domain
ldap.authentication.userNameFormat=%s@email.es

# The LDAP context factory to use
ldap.authentication.java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory

# The URL to connect to the LDAP server
ldap.authentication.java.naming.provider.url=ldap://xxx.xxx.xxx.xxx:xxx

# The authentication mechanism to use for password validation
ldap.authentication.java.naming.security.authentication=simple

# Escape commas entered by the user at bind time
# Useful when using simple authentication and the CN is part of the DN and contains commas
ldap.authentication.escapeCommasInBind=false

# Escape commas entered by the user when setting the authenticated user
# Useful when using simple authentication and the CN is part of the DN and contains commas, and the escaped \, is
# pulled in as part of an LDAP sync
# If this option is set to true it will break the default home folder provider as space names can not contain \
ldap.authentication.escapeCommasInUid=false

# Comma separated list of user names who should be considered administrators by default
ldap.authentication.defaultAdministratorUserNames=nombre1,nombre2

# This flag enables use of this LDAP subsystem for user and group
# synchronization. It may be that this subsytem should only be used for
# authentication, in which case this flag should be set to false.
ldap.synchronization.active=true

# The authentication mechanism to use for synchronization
ldap.synchronization.java.naming.security.authentication=simple

# The default principal to bind with (only used for LDAP sync). This should be a UPN or DN
ldap.synchronization.java.naming.security.principal=alfresco@email.es

# The password for the default principal (only used for LDAP sync)
ldap.synchronization.java.naming.security.credentials=Password

# If positive, this property indicates that RFC 2696 paged results should be
# used to split query results into batches of the specified size. This
# overcomes any size limits imposed by the LDAP server.
ldap.synchronization.queryBatchSize=1000

# If positive, this property indicates that range retrieval should be used to fetch
# multi-valued attributes (such as member) in batches of the specified size.
# Overcomes any size limits imposed by Active Directory.       
ldap.synchronization.attributeBatchSize=1000

# The query to select all objects that represent the groups to import.
ldap.synchronization.groupQuery=(objectclass\=group)

# The query to select objects that represent the groups to import that have changed since a certain time.
#ldap.synchronization.groupDifferentialQuery=(&(objectclass\=group)(!(modifyTimestamp<\={0})))
ldap.synchronization.groupDifferentialQuery=(objectclass\=group)

# The query to select all objects that represent the users to import.
ldap.synchronization.personQuery=(&(objectclass\=user)(userAccountControl\:x.x.xxx.xxxxxx.x.x.xxx\:\=xxx))

# The query to select objects that represent the users to import that have changed since a certain time.
ldap.synchronization.personDifferentialQuery=(&(objectclass\=user)(userAccountControl\:x.x.xxx.xxxxxx.x.x.xxx\:\=xxx))

# The group search base restricts the LDAP group query to a sub section of tree on the LDAP server.
ldap.synchronization.groupSearchBase=ou\=Grupos,dc=empresa,dc=es

# The user search base restricts the LDAP user query to a sub section of tree on the LDAP server.
ldap.synchronization.userSearchBase=dc\=empresa,dc=es

# The name of the operational attribute recording the last update time for a group or user.
ldap.synchronization.modifyTimestampAttributeName=modifyTimestamp

# The timestamp format. Unfortunately, this varies between directory servers.
ldap.synchronization.timestampFormat=yyyyMMddHHmmss'.0Z'

# The attribute name on people objects found in LDAP to use as the uid in Alfresco
ldap.synchronization.userIdAttributeName=sAMAccountName

# The attribute on person objects in LDAP to map to the first name property in Alfresco
ldap.synchronization.userFirstNameAttributeName=givenName

# The attribute on person objects in LDAP to map to the last name property in Alfresco
ldap.synchronization.userLastNameAttributeName=sn

# The attribute on person objects in LDAP to map to the email property in Alfresco
ldap.synchronization.userEmailAttributeName=mail

# The attribute on person objects in LDAP to map to the organizational id  property in Alfresco
ldap.synchronization.userOrganizationalIdAttributeName=EMPRESA

# The default home folder provider to use for people created via LDAP import
ldap.synchronization.defaultHomeFolderProvider=userHomesHomeFolderProvider

# The attribute on LDAP group objects to map to the authority name property in Alfresco
ldap.synchronization.groupIdAttributeName=cn

# The attribute on LDAP group objects to map to the authority display name property in Alfresco
ldap.synchronization.groupDisplayNameAttributeName=displayName

# The group type in LDAP
ldap.synchronization.groupType=group

# The person type in LDAP
ldap.synchronization.personType=user

# The attribute in LDAP on group objects that defines the DN for its members
ldap.synchronization.groupMemberAttributeName=member

# If true progress estimation is enabled. When enabled, the user query has to be run twice in order to count entries.
ldap.synchronization.enableProgressEstimation=true

El caso es que nos surge una duda. ¿Cuándo se realiza la sincronización de usuarios (a parte de cuando se inicia Alfresco)?

Resulta curioso, el sistema funciona bien, pero parece que falta una propiedad que he visto por ahí: ldap.synchronisation.import.person.cron, que es la que indica cuándo debe Alfresco traerse los usuarios y grupos del LDAP.

¿Puede ser que si un usuario se intenta loguear sin estar en la Base de Datos de Alfresco, éste se lo traiga del LDAP y lo cree "al vuelo"?

Muchas gracias de antemano, un saludo!
4 Replies
cristinamr
Advanced

Re: Sincronización LDAP sin 'cron'

¿Puede ser que si un usuario se intenta loguear sin estar en la Base de Datos de Alfresco, éste se lo traiga del LDAP y lo cree "al vuelo"?

Si solo autenticas, sí. Lo creará solo con el nombre que meta para acceder y el pass. Aunque también ocurre esto si no tienes un Cron para definir el tiempo de sincronización (synchronization.import.cron=XXXXXX).

Quizás deberías leerte este artículo, a lo mejor te viene bien como documentación =)

Un saludo.
--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc
rhakaro
Member II

Re: Sincronización LDAP sin 'cron'

Hola CristinaMR,

Muchísimas gracias por tu respuesta. No es de gran ayuda, ya que necesitamos ejecutar una acción en el momento de la sincronización con LDAP. Sabiendo que en nuestro caso ésta se realiza en los arranques y los login, suficiente.

Un saludo!
cristinamr
Advanced

Re: Sincronización LDAP sin 'cron'

De nada ¡a mandar!  :mrgreen: Mientras se pueda echar un cable perfecto (sino habrá que tirar de google jaja).

Oye si la respuesta te ha servido ¿la podrías marcar como útil? (en mi réplica, abajo de mi nombre tienes "Útil Sí/No" marca sí y listo  :wink: ).

¡Un saludooo!
--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc
rhakaro
Member II

Re: Sincronización LDAP sin 'cron'

La marqué como útil en cuanto la leí Smiley Wink
Muchas gracias!