BZ7R536TG57J2BQ46FCV4TBSQPFODY7VACT3KW5J2IYKGTYUMURQC </para></section><section><title>Using LDAP as authentication backend (optional)</title><para>Instead of using Hydra's built-in user management you can optionally use LDAP to manage roles and users.</para><para>The <command>hydra-server</command> accepts the environmentvariable <emphasis>HYDRA_LDAP_CONFIG</emphasis>. The value ofthe variable should point to a valid YAML file containing theCatalyst LDAP configuration. The format of the configurationfile is describe in the<link xlink:href="https://metacpan.org/pod/Catalyst::Authentication::Store::LDAP#CONFIGURATION-OPTIONS"><emphasis>Catalyst::Authentication::Store::LDAP</emphasis> documentation</link>.An example is given below.</para>
<para>Roles can be assigned to users based on their LDAP group membership(<emphasis>use_roles: 1</emphasis> in the below example).For a user to have the role <emphasis>admin</emphasis> assigned to themthey should be in the group <emphasis>hydra_admin</emphasis>. In generalany LDAP group of the form <emphasis>hydra_some_role</emphasis>(notice the <emphasis>hydra_</emphasis> prefix) will work.
<screen>credential:class: Passwordpassword_field: passwordpassword_type: self_checkstore:class: LDAPldap_server: localhostldap_server_options.timeout: 30binddn: "cn=root,dc=example"bindpw: notapasswordstart_tls: 0start_tls_optionsverify: noneuser_basedn: "ou=users,dc=example"user_filter: "(&(objectClass=inetOrgPerson)(cn=%s))"user_scope: oneuser_field: cnuser_search_options:deref: alwaysuse_roles: 1role_basedn: "ou=groups,dc=example"role_filter: "(&(objectClass=groupOfNames)(member=%s))"role_scope: onerole_field: cnrole_value: dnrole_search_options:deref: always</screen>