Diferencia entre revisiones de «Active Directory»

De MoodleDocs
(added page)
 
 
(No se muestran 5 ediciones intermedias del mismo usuario)
Línea 1: Línea 1:
{{Autenticación}}{{Pendiente de traducir}}
{{Autenticación}}
Microsoft's Active Directory (AD) provides a variety of network directory services including Lightweight Directory Access Protocol (LDAP) like functions. It is included in Windows 2000 Server and later versions of their operating system.   The focus of this page will be with the [[Autenticación LDAP]] functions.
Active Directory (AD) de Microsoft proporciona una variedad de servicios de directorio de red, incluidas funciones similares al Protocolo Ligero de Acceso a Directorios ''(LDAP Lightweight Directory Access Protocol)''. Está incluido en Windows 2000 Server y versiones posteriores de su sistema operativo. El foco de esta página serán  las funciones [[Autenticación LDAP]].




==Troubleshooting AD and LDAP authentication==
== Solución de problemas de autenticación AD y LDAP ==
===Warning: The PHP LDAP module does not seem to be present. Please ensure it is installed and enabled.===
=== Advertencia: El módulo PHP LDAP no parece estar presente. Asegúrese de que esté instalado y habilitado. ===
This usually means that the main ldap dll or one of the supporting dlls are missing.
Por lo general, esto significa que falta la dll ldap principal o una de las dll de soporte.
Let's start with the main one itself.  
Comencemos con el principal en sí.
Browse to <nowiki>http://(moodleserver)/admin/phpinfo.php</nowiki> and examine the "Configuration File (php.ini) Path" field to determine which php.ini is being used and open it with an editor. Find the line 'extension=php_ldap.dll' and take out the semi-colon if it is there. That semi-colon will stop it loading the module all together!  
Vaya a <nowiki> http: // (moodleserver) /admin/phpinfo.php </nowiki> y examine el campo "Ruta del archivo de configuración (php.ini)" para determinar qué php.ini se está utilizando y ábralo con un editor. Busque la línea 'extension=php_ldap.dll' y elimine el punto y coma si está allí. ¡Ese punto y coma detendrá la carga del módulo por completo!
While you have that file open, search for 'extension_dir' and note which folder it is set to. Open that folder and ensure the php_ldap.dll file is in there. If it isn't then put it in there.
Mientras tenga ese archivo abierto, busque 'extension_dir' y observe en qué carpeta está configurado. Abra esa carpeta y asegúrese de que el archivo php_ldap.dll esté allí. Si no es así, colóquelo allí.
If that still hasn't fixed it you are missing a supporting dll, but you don't get told that. To see what dlls are missing open the Command Prompt and navigate to the php directory and execute the following line 'php -m'. You should get some error messages now. Ugly, but at least they give you information! Find the dlls listed and copy them to the php directory. You may now need to restart the apache/httpd service. Run 'php -m' again and you should be error free and the message in Moodle should be gone now.
Si eso aún no lo ha solucionado, le falta una dll de soporte, pero no se le dice eso. Para ver qué dlls faltan, abra el símbolo del sistema y navegue hasta el directorio php y ejecute la siguiente línea 'php -m'. Debería recibir algunos mensajes de error ahora. Feo, ¡pero al menos te dan información! Busque las DLL en la lista y cópielas en el directorio php. Es posible que ahora deba reiniciar el servicio apache / httpd. Ejecute 'php -m' nuevamente y debería estar libre de errores y el mensaje en Moodle debería desaparecer ahora.


===LDAP-module cannot connect any LDAP servers===
=== El módulo LDAP no puede conectar ningún servidor LDAP ===
  LDAP-module cannot connect any LDAP servers:  
  El módulo LDAP no puede conectar ningún servidor LDAP:
  Server: 'ldap://my.ldap.server/'  
  Servidor: 'ldap: //my.ldap.server/'
  Connection: 'Resource id #26' Bind result: ''
  Conexión: 'Resource id #26' Bind result:''
Getting this message when you are trying to log in is a result of incorrect details for the Bind user, or the user account having insufficient permissions in Active Directory. The best way to test and resolve this is use ldp.exe to test binding until it suceeds. There are instructions on installing ldp.exe below.
Recibir este mensaje cuando intenta iniciar sesión es el resultado de detalles incorrectos del usuario de Bind o de que la cuenta de usuario tiene permisos insuficientes en Active Directory. La mejor manera de probar y resolver esto es usar ldp.exe para probar el enlace hasta que tenga éxito. A continuación, encontrará instrucciones para instalar ldp.exe.
Open the program and Connect to AD, giving the server name, then from the Connection menu choose Bind. Enter the details you think are correct and you will probably find that an error is returned. Try adjusting the accounts priveleges or another account until you are returned an "Authenticated as" message.
Abra el programa y Conéctese a AD, dando el nombre del servidor, luego en el menú Conexión elija Vincular. Ingrese los detalles que crea que son correctos y probablemente encontrará que se devuelve un error. Intente ajustar los privilegios de las cuentas u otra cuenta hasta que se le devuelva un mensaje "Autenticado como".
Once you are sure your account can be used to bind to AD, check that the DN of that users name is correct. Expand the tree on the left until you find the user you used to bind. Right click on that item and choose Copy DN. Go to the User Authentication page in Moodle and paste the value into the ldap_bind_dn field. Add the password and you can now feel safe your user is binding sucessfully.
Una vez que esté seguro de que su cuenta puede usarse para vincularse a AD, verifique que el DN del nombre de ese usuario sea correcto. Expanda el árbol de la izquierda hasta que encuentre el usuario que solía vincular. Haga clic derecho en ese elemento y elija Copiar DN. Vaya a la página de Autenticación de usuario en Moodle y pegue el valor en el campo ldap_bind_dn. Agregue la contraseña y ahora puede sentirse seguro de que su usuario se vincula correctamente.


===Getting correct CNs for Contexts and Creators===
=== Obtener CNs correctos para contextos y creadores ===
For those not familiar with AD this could be very confusing, and not that easy for some who are familiar with it. Again, ldp.exe is your friend. There are instructions on installing ldp.exe below.
Para aquellos que no están familiarizados con la AD, esto puede resultar muy confuso y no tan fácil para quienes están familiarizados con ella. De nuevo, ldp.exe es tu amigo. A continuación, encontrará instrucciones para instalar ldp.exe.
Open it up and expand the tree on the left until you find the group or user you want to use and right click on it and select Copy DN. Go back to the Moodle User Authentication page and paste that value into either ldap_contexts or ldap_creators.
Ábralo y expanda el árbol de la izquierda hasta que encuentre el grupo o usuario que desea usar y haga clic derecho sobre él y seleccione Copiar DN. Regrese a la página de Autenticación de usuario de Moodle y pegue ese valor en ldap_contexts o ldap_creators.


===Getting the right user_attribute===
=== Obtener el atributo de usuario correcto ===
By default, Moodle uses an accounts cn (full name) to verify against, but most networks don't use a full given name for logon as it's too easy to guess and you can easily have two people with the same name. If this is the case for you too you need to tell Moodle to look at another field for the logon id.
De forma predeterminada, Moodle usa una cuenta cn (nombre completo) para verificar, pero la mayoría de las redes no usan un nombre completo para iniciar sesión, ya que es demasiado fácil de adivinar y puede tener fácilmente dos personas con el mismo nombre. Si este es su caso también, debe decirle a Moodle que busque en otro campo la identificación de inicio de sesión.
In ldp.exe navigate the tree on the left to find a user account, preferably your own. Double-click the item in the tree and full-details will be loaded into the screen on the right. Look down the details until you find your logon id and note the item listed against it. For me, and a lot of people, it is sAMAccountName. Copy this name and paste it into the ldap_user_attribute on the Moodle User Authentication page.
En ldp.exe, navegue por el árbol de la izquierda para encontrar una cuenta de usuario, preferiblemente la suya. Haga doble clic en el elemento del árbol y los detalles completos se cargarán en la pantalla de la derecha. Mire los detalles hasta que encuentre su identificación de inicio de sesión y anote el elemento que aparece junto a él. Para mí, y para mucha gente, es sAMAccountName. Copie este nombre y péguelo en ldap_user_attribute en la página de autenticación de usuario de Moodle.
There are instructions on installing ldp.exe below.
A continuación, encontrará instrucciones para instalar ldp.exe.


===Installing ldp.exe Server Tool===
=== Instalación de la herramienta de servidor ldp.exe ===
ldp.exe comes as part of the Server Tools on most versions of Windows Server. Find your Windows Server installation disc and find a folder on it called Support\Tools. In there will be a SupTools.msi which will install the server tools if run. You should now have a folder under Program Files called Support Tools, in which will be ldp.exe. ldp.exe is also available in the Windows XP Support Tools, which you can download from Microsoft [http://www.microsoft.com/downloads/details.aspx?FamilyId=49AE8576-9BB9-4126-9761-BA8011FABF38&displaylang=en here]. Alternatively, a single download of ldp.exe is available [http://www.computerperformance.co.uk/w2k3/utilities/ldp.htm here].
ldp.exe viene como parte de las herramientas de servidor en la mayoría de las versiones de Windows Server. Busque su disco de instalación de Windows Server y busque una carpeta llamada Support \ Tools. En habrá un SupTools.msi que instalará las herramientas del servidor si se ejecuta. Ahora debería tener una carpeta en Archivos de programa llamada Herramientas de soporte, en la que estará ldp.exe. ldp.exe también está disponible en las herramientas de soporte de Windows XP, que puede descargar de Microsoft [http://www.microsoft.com/downloads/details.aspx?FamilyId=49AE8576-9BB9-4126-9761-BA8011FABF38&displaylang=en aquí ]. Alternativamente, se encuentra disponible una única descarga de ldp.exe [http://www.computerperformance.co.uk/w2k3/utilities/ldp.htm aquí].


===Example Active Directory Configuration===
=== Ejemplo de configuración de Active Directory ===
Below is an example configuration for Active Directory. As detailed above, the values may vary based on your local Active Directory configuration, but should provide a good starting point for most cases.
A continuación se muestra una configuración de ejemplo para Active Directory. Como se detalla anteriormente, los valores pueden variar según la configuración de Active Directory local, pero deberían proporcionar un buen punto de partida para la mayoría de los casos.


  ldap_host_url = ldap://ads.example.com
  ldap_host_url = ldap: //ads.example.com
  ldap_version = 3
  ldap_version = 3
  ldap_preventpassindb = yes
  ldap_preventpassindb = yes
Línea 40: Línea 40:
  ldap_bind_pw = bind-password
  ldap_bind_pw = bind-password
  ldap_user_type = MS ActiveDirectory
  ldap_user_type = MS ActiveDirectory
  ldap_contexts = ou=moodleusers,dc=example,dc=com
  ldap_contex
ldap_user_attribute = sAMAccountName
 
 
Note that the ldap_bind_dn value should work in either the CN=bin-user,CN=Users,DC=example,DC=com format as shown in the main instructions or the bind-user@example.com format shown in this example.
 
==Global Catalogs==
Moodle currently only has limited support for multiple domain controllers; specifically it expects each of the LDAP servers listed to contain identical sets of information. If you have users in multiple domains this presents an issue. One solution when working with MS-AD is to use the Global Catalog. The Global Catalog is designed to be a read-only, partial representation of an entire MS-AD forest, designed for searching the entire directory when the domain of the required object is not known.
 
===Enabling the Global Catalog===
 
The Global Catalog is available on Windows 2000 and Windows 2003 Active Directory servers. To enable, open the ‘Active Directory Sites and Services’ MMC (Microsoft Management Console) snap-in. Extend ‘Sites’ and then the name of the Site containing the active directory forest you wish to use. Expand the server you wish to enable the Global Catalog on, right click ‘NTDS settings’ and select the ‘Properties’ tab. To enable, simply click the ‘Global Catalog’ checkbox. Under a Windows 2000 server it is necessary to restart the server (although it won’t prompt you to); under Windows 2003 server it is not necessary to restart the server. In either case you will generally have to wait for the AD forest to replicate before the Global Catalog offers a representation of the entire AD forest. Changes made in Active Directory will also be subject to a short delay due to the latency involved with replication. If your AD servers are firewalled port 3268 will need to be opened for Global Catalog servers.
If your organisation uses Microsoft Exchange then it its highly likely that at least one Domain Controller will already have Global Catalog enabled – Exchange 2000 and 2003 rely on the Global Catalog for address information, users also access the Global Catalog when using the GAL (Global Address List)
 
 
===Child Domains===
If your organisation has a main domain example.org, staff and students are contained in two child domains staff.example.org and students.example.org. The 3 domains (example.org, staff.example.org and students.example.org) each have a domain controller (dc01, dc02 and dc03 respectively.) Each domain controller contains a full, writable, representation of only the objects that belong to its domain. However, assuming that the Global Catalog has been enabled (see below) on one of the domain controllers (for example dc01) a query to the Global Catalog would reveal matching objects from all three domains. The Global Catalog is automatically maintained through replication across the active directory forest, it can also be enabled on multiple servers (if, for example, you need redundancy / load balancing.)
 
To make use of this in Moodle to allow logins from multiple domains is simple. The Global Catalog runs on port 3268 as opposed to 389 for standard LDAP queries. As a result, still assuming the Global Catalog is running on dc01, the ''''ldap_host_url'''' would be ''ldap://dc01.example.org:3268''. The rest of the settings are the same as for other MS-AS Auth setups.
 
You should use the ''''ldap_contexts'''' setting to indicate the locations of individuals you wish to grant access. To extend the example above a little: In the example.org domain users are all in the'' 'Users' ''OU, in the staff.example.org domain users are in two OUs at the root of the domain,'' 'Support Staff' ''and'' 'Teaching Staff' '', and in the students.example.org domain students are in an OU indicating the year that they enrolled, all of which are under the'' 'Students' ''OU. As a result our ''''ldap_contexts'''' setting may look a little like this:'' 'OU=Users,DC=example,DC=org; OU=Support Staff,DC=staff,DC=example,DC=org; OU=Teaching Staff,DC=staff,DC=example,DC=org; OU=Students,DC=students,DC=example,DC=org''.' The ''''ldap_search_sub'''' option should be set to'' 'Yes' ''to allow moodle to search within the child OUs.
 
Its worth noting that the Global Catalog only contains a partial representation of the attributes of each object, as defined in the Partial Attribute Set supplied by Microsoft. However common information likely to be of use to a general Moodle installation (Forename, Surname, Email Address, sAMAccountName etc) is included in the set. For specific needs the schema can be altered to remove or add various attributes - see Microsoft [http://support.microsoft.com/kb/248717 KB248717] for more information.
 
In most cases the Global Catalog is read-only, update queries must be made over the standard LDAP ports to the domain controller that holds the object in question (in our example, updating a student's details would require an LDAP query to the students.example.org domain controller - dc03, it would not be possible to update details by querying the Global Catalog.) The exception to this would be in an environment where there is only a single domain in the active directory forest; in this case the Global Catalog holds a writable full set of attributes for each object in the domain. However, for the purposes of Moodle authorisation, there would be no need to use the Global Catalog in this case.
 
===MaxPageSize setting===
Modifying the number of Active Directory objects to search:
 
By default Active Directory only allows searches returning a limited number of objects per search. Since there is currently no Page control support in PHP 5.2.x which would enable smaller page searches you may need to modify your MaxPageSize setting to make sure LDAP Client searches can return enough user objects to support the number of authenticating users.
 
Note that starting with PHP version 5.4, PHP now supports page control. Newer versions of the LDAP configuration settings provide a value for page side. This value just needs to be set to a value less than the MaxPageSize of the Active Directory.
 
If you find that the script is not running through all of your users properly and you have MS Active Directory + over 1000 users, follow the instructions [http://support.microsoft.com/kb/315071 here] to set the MaxPageSize setting to a number higher than your total number of users (both now and in future) to fix it.  This is a forest-wide setting.
 
==MS Active Directory + SSL ==
 
If the Certificate Authority is not installed you'll have to install it first as follows:
# Click '''Start''' -> '''Control Panel''' -> '''Add or Remove programs.'''
# Click '''Add/Remove Windows Components''' and select '''Certificate Services.'''
# Follow the procedure provided to install the '''Certificate Authority'''. Enterprise level is a good choice.
 
Verify that SSL has been enabled on the server by installing suptools.msi from Windows installation cd's \Support\tools directory. After support tools installation:
# Select '''Start''' -> '''Run''', write '''ldp''' in the Open field.
# From the ldp window select '''Connection''' -> '''Connect''' and supply valid hostname and port number '''636'''. Also select the SSL check box.
 
If successful, you should get information about the connection.
 
See [[LDAP_authentication#Enabling_LDAPS_on_the_client_side_.28Moodle_server.29|Enabling LDAPS on the client side (Moodle server)]] for details on the client side configuration.
 
==See also==
*[[LDAP authentication]] in Moodle
*[http://en.wikipedia.org/wiki/Directory_service Directory services] overview in Wikipedia
*[http://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol LDAP] in Wikipedia
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=17198 Using multiple LDAP servers - Our students are on separate domain] forum discussion
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=74279 How to use multiple LDAP servers with Moodle 1.8] forum discussion




[[en:Active Directory]]
[[en:Active Directory]]
[[ja:Active Directory]]
[[ja:Active Directory]]
[[es:Active Directory]]

Revisión actual - 03:36 26 sep 2020

Active Directory (AD) de Microsoft proporciona una variedad de servicios de directorio de red, incluidas funciones similares al Protocolo Ligero de Acceso a Directorios (LDAP Lightweight Directory Access Protocol). Está incluido en Windows 2000 Server y versiones posteriores de su sistema operativo. El foco de esta página serán las funciones Autenticación LDAP.


Solución de problemas de autenticación AD y LDAP

Advertencia: El módulo PHP LDAP no parece estar presente. Asegúrese de que esté instalado y habilitado.

Por lo general, esto significa que falta la dll ldap principal o una de las dll de soporte. Comencemos con el principal en sí. Vaya a http: // (moodleserver) /admin/phpinfo.php y examine el campo "Ruta del archivo de configuración (php.ini)" para determinar qué php.ini se está utilizando y ábralo con un editor. Busque la línea 'extension=php_ldap.dll' y elimine el punto y coma si está allí. ¡Ese punto y coma detendrá la carga del módulo por completo! Mientras tenga ese archivo abierto, busque 'extension_dir' y observe en qué carpeta está configurado. Abra esa carpeta y asegúrese de que el archivo php_ldap.dll esté allí. Si no es así, colóquelo allí. Si eso aún no lo ha solucionado, le falta una dll de soporte, pero no se le dice eso. Para ver qué dlls faltan, abra el símbolo del sistema y navegue hasta el directorio php y ejecute la siguiente línea 'php -m'. Debería recibir algunos mensajes de error ahora. Feo, ¡pero al menos te dan información! Busque las DLL en la lista y cópielas en el directorio php. Es posible que ahora deba reiniciar el servicio apache / httpd. Ejecute 'php -m' nuevamente y debería estar libre de errores y el mensaje en Moodle debería desaparecer ahora.

El módulo LDAP no puede conectar ningún servidor LDAP

El módulo LDAP no puede conectar ningún servidor LDAP:
Servidor: 'ldap: //my.ldap.server/'
Conexión: 'Resource id #26' Bind result:

Recibir este mensaje cuando intenta iniciar sesión es el resultado de detalles incorrectos del usuario de Bind o de que la cuenta de usuario tiene permisos insuficientes en Active Directory. La mejor manera de probar y resolver esto es usar ldp.exe para probar el enlace hasta que tenga éxito. A continuación, encontrará instrucciones para instalar ldp.exe. Abra el programa y Conéctese a AD, dando el nombre del servidor, luego en el menú Conexión elija Vincular. Ingrese los detalles que crea que son correctos y probablemente encontrará que se devuelve un error. Intente ajustar los privilegios de las cuentas u otra cuenta hasta que se le devuelva un mensaje "Autenticado como". Una vez que esté seguro de que su cuenta puede usarse para vincularse a AD, verifique que el DN del nombre de ese usuario sea correcto. Expanda el árbol de la izquierda hasta que encuentre el usuario que solía vincular. Haga clic derecho en ese elemento y elija Copiar DN. Vaya a la página de Autenticación de usuario en Moodle y pegue el valor en el campo ldap_bind_dn. Agregue la contraseña y ahora puede sentirse seguro de que su usuario se vincula correctamente.

Obtener CNs correctos para contextos y creadores

Para aquellos que no están familiarizados con la AD, esto puede resultar muy confuso y no tan fácil para quienes están familiarizados con ella. De nuevo, ldp.exe es tu amigo. A continuación, encontrará instrucciones para instalar ldp.exe. Ábralo y expanda el árbol de la izquierda hasta que encuentre el grupo o usuario que desea usar y haga clic derecho sobre él y seleccione Copiar DN. Regrese a la página de Autenticación de usuario de Moodle y pegue ese valor en ldap_contexts o ldap_creators.

Obtener el atributo de usuario correcto

De forma predeterminada, Moodle usa una cuenta cn (nombre completo) para verificar, pero la mayoría de las redes no usan un nombre completo para iniciar sesión, ya que es demasiado fácil de adivinar y puede tener fácilmente dos personas con el mismo nombre. Si este es su caso también, debe decirle a Moodle que busque en otro campo la identificación de inicio de sesión. En ldp.exe, navegue por el árbol de la izquierda para encontrar una cuenta de usuario, preferiblemente la suya. Haga doble clic en el elemento del árbol y los detalles completos se cargarán en la pantalla de la derecha. Mire los detalles hasta que encuentre su identificación de inicio de sesión y anote el elemento que aparece junto a él. Para mí, y para mucha gente, es sAMAccountName. Copie este nombre y péguelo en ldap_user_attribute en la página de autenticación de usuario de Moodle. A continuación, encontrará instrucciones para instalar ldp.exe.

Instalación de la herramienta de servidor ldp.exe

ldp.exe viene como parte de las herramientas de servidor en la mayoría de las versiones de Windows Server. Busque su disco de instalación de Windows Server y busque una carpeta llamada Support \ Tools. En habrá un SupTools.msi que instalará las herramientas del servidor si se ejecuta. Ahora debería tener una carpeta en Archivos de programa llamada Herramientas de soporte, en la que estará ldp.exe. ldp.exe también está disponible en las herramientas de soporte de Windows XP, que puede descargar de Microsoft aquí . Alternativamente, se encuentra disponible una única descarga de ldp.exe aquí.

Ejemplo de configuración de Active Directory

A continuación se muestra una configuración de ejemplo para Active Directory. Como se detalla anteriormente, los valores pueden variar según la configuración de Active Directory local, pero deberían proporcionar un buen punto de partida para la mayoría de los casos.

ldap_host_url = ldap: //ads.example.com
ldap_version = 3
ldap_preventpassindb = yes
ldap_bind_dn = bind-user@example.com
ldap_bind_pw = bind-password
ldap_user_type = MS ActiveDirectory
ldap_contex