четверг, 13 августа 2009 г.

Настройка аутентификациии Intalio. LDAP.

Настройка Intalio на LDAP Apache Directory.
В Community Edition есть одна особенность при подключении к LDAP - нет возможности подключится к Active Directory. Весьма странно т.к. используется протокол LDAP. Подключение к Active Directory присутствует в Enterprise Edition.

Настройка Intalio|Server на Apache LDAP
1. Требуется скачать ApacheDS (Apache Directory Server) с http://directory.apache.org, затем его установить на Linux сервере.
2. Для удобного использования всех "прелестей" Apache LDAP качаем с http://directory.apache.org клиента Apache Directory Studio.
3. После установки Apache LDAP надо запустить сервер LDAP (Пример: >sudo /etc/rc.d/init.d/apacheds-1.5.4-company start). Останов сервера LDAP - >sudo /etc/rc.d/init.d/apacheds-1.5.4-company stop.
4. Затем после установки и старта сервера LDAP требуется настроить Intalio|Server на LDAP. Делается это следующим образом:
в файле [Intalio Server]/var/config/securityConfig.xml следует раскоментировать часть кода, которая выделена зеленым цветом (настройка аутентификации через LDAP), а ту часть, которая выделена красным цветом (это настройки аутентификации которые используют security.xml в качесте хранилища данных аутентификации) следует закоментировать.

[Intalio Server]/var/config/securityConfig.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<!--
Copyright (c) 2005-2006 Intalio inc.

All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html

Contributors:
Intalio inc. - initial API and implementation
-->
<beans>

<bean id="realms" class="org.intalio.tempo.security.impl.Realms">
<property name="defaultRealm" value="intalio"/>
<property name="securityProviders">
<list>
<ref bean="securityProvider"/>
</list>
</property>
</bean>

<!-- <bean id="securityProvider" class="org.intalio.tempo.security.simple.SimpleSecurityProvider" init-method="init">
<property name="configFile">
<value>${org.intalio.tempo.configDirectory}/security.xml</value>
</property>
</bean>-->

<!-- Uncomment this section (and comment the above SimpleSecurityProvider) to enable LDAP support -->
<bean id="securityProvider" class="org.intalio.tempo.security.ldap.LDAPSecurityProvider">
<property name="propertiesFile">
<value>${org.intalio.tempo.configDirectory}/ldap.properties</value>
</property>
</bean>

<bean id="tokenHandler" class="org.intalio.tempo.security.impl.TokenHandler">
<property name="secret"><value>mySecret</value></property>
</bean>

<bean id="tokenService" class="org.intalio.tempo.security.impl.TokenServiceImpl">
<property name="realms"><ref bean="realms"/></property>
<property name="tokenHandler"><ref bean="tokenHandler"/></property>
</bean>

</beans>

5. Теперь нужно произвести настройки в файле [Intalio Server]/var/config/LDAP.properties. В нем требуется прописать настройки нашего LDAP сервера:

[Intalio Server]/var/config/LDAP.properties:
(Зеленым выделены места изменения настроек)
#
# Configuration for Apache Directory Server
#

#
# The ULR for the LDAP Server
# The default is 'ldap=://localhost:389/'.
#URL Ldap сервера
java.naming.provider.url=ldap://localhost:10389

#
# The user of the LDAP Server connection
# For example: 'cn=Directory Manager'.
#Пользователь, который используется для подключения к LDAP
#изменять его не требуется
java.naming.security.principal=uid=admin,ou=system

#
# The credentials or password of the connection
# For example: 'password'.
#Пароль для вышеприведенного пользователя
java.naming.security.credentials=secret

#
# Authetication method to connect to the LDAP Server
# The default is 'simple'.
#
java.naming.security.authentication=simple

#
# The supported realm(s) for the directory. The properties
# list name of the realm, and the base DN separated by a
# colon (':')
# For example: 'airrus:dc=airrus,dc=com'.
#контроллер домена idirectory можно создать в apach directory studio
security.ldap.realm.0=intalio:dc=idirectory

#
# The ldap factory for the directory service
# The default is 'com.sun.jndi.ldap.LdapCtxFactory'.
# (without quotes, same below)
#
java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory

#
# The user's sub-context
# For example: 'ou=People', if people belongs to
# 'ou=People'
#Место где будут находится наши пользователи (создаем в Apache Directory Studio)
security.ldap.user.base=ou=Users

#
# The role or group's sub-context
# For example: 'ou=Roles', if roles belongs to
# 'ou=Roles'.
#Роли наших пользователей
security.ldap.role.base=ou=Roles

#
# An LDAP attribute name that identifies an user
# For example: 'uid'.
#Аттрибут для индентификации пользователей
security.ldap.user.id=cn

#
# The LDAP attribute name that identifies a role
# For example: 'cn'.
#
#Аттрибут для индентификации ролей пользователей
security.ldap.role.id=cn

#
# The LDAP attribute name that references a role's ascendants
# If this attribute is specified, leave 'security.ldap.role.descen' out
# For example, if standard Role is used for access control, specify
# 'nsRoleDN' or a corresponding attribute of the particular server,
# and leave out security.ldap.role.descen properties.
#
#security.ldap.role.ascen=nsRoleDN

#
# The LDAP attribute name that references a role's descendants or members.
# If this attribute is specified, leave security.ldap.role.ascen out.
# For example, if Group is used for access control, specify 'member'
# or a corresponding attribute of the particular server, and leave out
# security.ldap.role.ascen
#
#security.ldap.role.descen=uniquemember

#
# The LDAP attribute name of an user object that references the user's roles
# For example, 'nsRoleDN'.
#
#security.ldap.user.roles=nsRoleDN

#
# The LDAP attribute name of a role (or group) that references the role's
# users.
# For example, 'uniquemember'.
#Аттрибут для пользователей роли
security.ldap.role.users=uniquemember

#
# The attribute name of an user's calculated effective roles.
# If Role is used, specify 'nsRole' or a corresponding attribute
# of the particular server. For Group with Active Directory,
# specify 'memberOf'. If unsure, leaves it out
#
#security.ldap.user.allroles=nsRole

#
# The permissions' sub-context
# For example, 'ou=Permission'.
#
security.ldap.perm.base=ou=Permission

#
# The LDAP attribute name of a role that references permission objects
# For example: 'permissions'.
#
security.ldap.role.perms=permission

#
# The LDAP attribute of permission object that reference the permission's
# roles or groups
# For example: 'nsRoleDN'.
#
#security.ldap.perm.roles=nsRoleDN

#
# The LDAP attribute of permission object that references the permission's
# protected resources.
# For example: 'resource'.
#
security.ldap.perm.objects=resource

#
# The LDAP attribute name that identifies a permission object
# For example, 'cn'.
#
security.ldap.perm.id=cn

#
# The LDAP attributes names of an user's credentials or passwords
# of the user.
# Format: 'ldap property:alias'
# For example, 'userPassword:password'.
#
security.ldap.user.credential.0=userPassword:password
#security.ldap.user.credential.1=userCertificate

#
# The LDAP attribute names of an user
# Format: 'ldap property:alias'
#
security.ldap.user.prop.0=cn
security.ldap.user.prop.1=ou
security.ldap.user.prop.2=objectclass:objectclass
security.ldap.user.prop.3=sn
security.ldap.user.prop.4=givenname:givenname
security.ldap.user.prop.5=mail:email
security.ldap.user.prop.6=:uid
security.ldap.user.prop.7=l:streetaddress
security.ldap.user.prop.8=roomNumber:roomnumber
security.ldap.user.prop.9=nsrole:nsrole
security.ldap.user.prop.10=nsroledn:nsroledn
security.ldap.user.prop.11=telephoneNumber:phone
#Красным выделены аттрибуты, которые были созданы вручную
security.ldap.user.prop.12=myMail

security.ldap.user.prop.13=bossMail
security.ldap.user.prop.14=zFIO
security.ldap.user.prop.15=TopManMail
security.ldap.user.prop.16=MarketingMail
security.ldap.user.prop.17=ProjectManagerMail

#
# The LDAP atrribute names of a role or group
# Format: 'ldap property:alias'
#
security.ldap.role.prop.0=cn:cn
security.ldap.role.prop.1=ou:ou
security.ldap.role.prop.2=ObjectClass:objectclass
security.ldap.role.prop.3=uniquemember:member

Таким образом, меняем на свои значения только те значения, коорые выделены зеленым цветом. Красным выделены аттрибуты, созданные вручную в Apache LDAP, в поставке Intalio|Server в данном файле их нет - они добавляются вручную по мере необходимости.

6. Продолжаем настройку LDAP сервера.
Путь к настройкам LDAP сервера:
/etc/rc.d/init.d/apacheds-1.5.4-company в этом файле находится путь по которому находятся настройки

INSTANCE_HOME="/var/lib/apacheds-1.5.4"
APACHEDS_HOME="/opt/apacheds-1.5.4"
INSTANCE="company"

INSTANCE_HOME/INSTANCE ― ПУТЬ к настройкам

/opt/apacheds-1.5.4/conf/apacheds.conf — файл с путем по нижней строчке точно также можно определить путь
wrapper.app.parameter.3=%INSTANCE_HOME%/%INSTANCE%/conf/server.xml

Продолжаем настройку LDAP сервера:
Для окончательной настройки LDAP сервера необходимо произвести небольшие изменения в файле настроек /var/lib/apacheds-1.5.4/company/conf/server.xml

Изменения выделены зеленым цветом:
<!-- Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->


<spring:beans xmlns:spring="http://xbean.apache.org/schemas/spring/1.0"
xmlns:s="http://www.springframework.org/schema/beans"
xmlns="http://apacheds.org/config/1.0">

<defaultDirectoryService id="directoryService" instanceId="default"
<!-- рабочая директория, т.е. то место где будут располагаться данные Directory-->
workingDirectory="idirectory"

allowAnonymousAccess="true"
accessControlEnabled="false"
denormalizeOpAttrsEnabled="false">
<systemPartition>
<!-- use the following partitionConfiguration to override defaults for -->
<!-- the system partition -->
<jdbmPartition id="system" cacheSize="100" suffix="ou=system" optimizerEnabled="true" syncOnWrite="true">
<indexedAttributes>
<jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.1" cacheSize="100"/>
<jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.2" cacheSize="100"/>
<jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.3" cacheSize="100"/>
<jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.4" cacheSize="100"/>
<jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.5" cacheSize="10"/>
<jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.6" cacheSize="10"/>
<jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.7" cacheSize="10"/>
<jdbmIndex attributeId="ou" cacheSize="100"/>
<jdbmIndex attributeId="uid" cacheSize="100"/>
<jdbmIndex attributeId="objectClass" cacheSize="100"/>
</indexedAttributes>
</jdbmPartition>
</systemPartition>

<partitions>
<!-- NOTE: when specifying new partitions you need not include those -->
<!-- attributes below with OID's which are the system indices, if left -->
<!-- out they will be automatically configured for you with defaults. -->
<!--(DC=IDIRECTORY ― доменное имя - верхний уровень directory)-->
<jdbmPartition id="idirectory" cacheSize="100" suffix="dc=idirectory" optimizerEnabled="true"
syncOnWrite="true">
<indexedAttributes>
<jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.1" cacheSize="100"/>
<jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.2" cacheSize="100"/>
<jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.3" cacheSize="100"/>
<jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.4" cacheSize="100"/>
<jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.5" cacheSize="10"/>
<jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.6" cacheSize="10"/>
<jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.7" cacheSize="10"/>
<jdbmIndex attributeId="dc" cacheSize="100"/>
<jdbmIndex attributeId="ou" cacheSize="100"/>
<jdbmIndex attributeId="krb5PrincipalName" cacheSize="100"/>
<jdbmIndex attributeId="uid" cacheSize="100"/>
<jdbmIndex attributeId="objectClass" cacheSize="100"/>
</indexedAttributes>
</jdbmPartition>
</partitions>

<interceptors>
<normalizationInterceptor/>
<authenticationInterceptor/>
<aciAuthorizationInterceptor/>
<defaultAuthorizationInterceptor/>
<exceptionInterceptor/>
<operationalAttributeInterceptor/>

<!-- Uncomment to enable the password policy interceptor
<passwordPolicyInterceptor/>
<keyDerivationInterceptor/>
-->

<schemaInterceptor/>
<subentryInterceptor/>
<collectiveAttributeInterceptor/>
<eventInterceptor/>
<triggerInterceptor/>

<!-- Uncomment to enable replication interceptor
<replicationInterceptor>
<configuration>
<replicationConfiguration serverPort="10390" peerReplicas="instance_b@localhost:10392">
<replicaId>
<replicaId id="instance_a"/>
</replicaId>
</replicationConfiguration>
</configuration>
</replicationInterceptor>
-->
</interceptors>
</defaultDirectoryService>

<standardThreadPool id="standardThreadPool" maxThreads="8"/>
<datagramAcceptor id="datagramAcceptor" logicExecutor="#standardThreadPool"/>
<socketAcceptor id="socketAcceptor" logicExecutor="#standardThreadPool"/>

<!-- missing atou=users,dc=example,dc=com
<changePasswordServer ipPort="60464">
<directoryService>#directoryService</directoryService>
<datagramAcceptor>#datagramAcceptor</datagramAcceptor>
<socketAcceptor>#socketAcceptor</socketAcceptor>
</changePasswordServer>
-->
<!-- missing atou=users,dc=example,dc=com
<kdcServer ipPort="60088">
<directoryService>#directoryService</directoryService>
<datagramAcceptor>#datagramAcceptor</datagramAcceptor>
<socketAcceptor>#socketAcceptor</socketAcceptor>
</kdcServer>
-->
<ntpServer ipPort="60123">
<datagramAcceptor>#datagramAcceptor</datagramAcceptor>
<socketAcceptor>#socketAcceptor</socketAcceptor>
</ntpServer>
<!-- missing atou=users,dc=example,dc=com
<dnsServer ipPort="8053">
<directoryService>#directoryService</directoryService>
<datagramAcceptor>#datagramAcceptor</datagramAcceptor>
<socketAcceptor>#socketAcceptor</socketAcceptor>
</dnsServer>
-->

<ldapService id="ldapsService"
enabled="true"
ipPort="10636"
enableLdaps="true">
<directoryService>#directoryService</directoryService>
<socketAcceptor>#socketAcceptor</socketAcceptor>
</ldapService>


<ldapService id="ldapService"
<!--(порт на котором будет работать LDAPserver)-->
ipPort="10389"
<!--(Анонимный дотуп отключен)-->
allowAnonymousAccess="false"
<!--(Пока понятия не имею что это ― но должно быть так - разобраться!!!)-->
saslHost="ldap.idirectory"
saslPrincipal="ldap/ldap.idirectory@IDIRECTORY <mailto:ldap/ldap.idirectory@IDIRECTORY>"
(место поиска как понял пользователя LDAP Server)-->
searchBaseDn="ou=users,ou=system"

maxTimeLimit="15000"
maxSizeLimit="1000">

<directoryService>#directoryService</directoryService>
<socketAcceptor>#socketAcceptor</socketAcceptor>

<!-- The list of supported authentication mechanisms. -->
<saslMechanismHandlers>
<simpleMechanismHandler mech-name="SIMPLE"/>
<cramMd5MechanismHandler mech-name="CRAM-MD5" />
<digestMd5MechanismHandler mech-name="DIGEST-MD5" />
<gssapiMechanismHandler mech-name="GSSAPI" />
<ntlmMechanismHandler mech-name="NTLM" ntlmProviderFqcn="com.foo.Bar"/>
<ntlmMechanismHandler mech-name="GSS-SPNEGO" ntlmProviderFqcn="com.foo.Bar"/>
</saslMechanismHandlers>

<!-- The desired quality-of-protection, used by DIGEST-MD5 and GSSAPI. -->
<saslQop>
<s:value>auth</s:value>
<s:value>auth-int</s:value>
<s:value>auth-conf</s:value>
</saslQop>

<!-- The realms serviced by this SASL host, used by DIGEST-MD5 and GSSAPI. -->
<saslRealms>
<s:value>idirectory</s:value>
<s:value>apache.org</s:value>
</saslRealms>

<!-- the collection of extended operation handlers to install -->
<extendedOperationHandlers>
<startTlsHandler/>
<gracefulShutdownHandler/>
<launchDiagnosticUiHandler/>
<!-- The Stored Procedure Extended Operation is not stable yet and it may cause security risks.-->
<!--storedProcedureExtendedOperationHandler/-->
</extendedOperationHandlers>
</ldapService>


<apacheDS id="apacheDS"
synchPeriodMillis="15000"
allowAnonymousAccess="false">

<directoryService>#directoryService</directoryService>
<ldapService>#ldapService</ldapService>
<ldapsService>#ldapsService</ldapsService>
</apacheDS>

<!-- another bean I didn't convert -->
<spring:bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<spring:property name="customEditors">
<spring:map>
<spring:entry key="javax.naming.directory.Attributes">
<spring:bean class="org.apache.directory.server.core.configuration.AttributesPropertyEditor"/>
</spring:entry>
</spring:map>
</spring:property>
</spring:bean>
</spring:beans>

Все настройка LDAP + Intalio|Server завершена!!! Далее следует перейти к созданию пользователей.
Эту статью Вы можете прочитать на новом блоге 

Комментариев нет:

Отправить комментарий

Примечание. Отправлять комментарии могут только участники этого блога.