вторник, 23 марта 2010 г.

Настройка Intalio|Server для работы с Microsoft Active Directory

Как и обещал ранее, в данной статье я расскажу как настроить Intalio|Server для работы с Microsoft Active Directory.
Хоть и на официальном сайте Intalio говориться о том, что использование Microsoft AD возможно только в Enterprise версии в это верить особо не стоит. Для настройки нам понадобиться:
1. Внести изменения в ldap.properties
2. Обновить библиотеки security

1. Изменение настроек ldap.properties
Не удивляйтесь, что изменения в данном файле-настроек будут незначительные. Ниже приведен листинг ldap.properties:


#
# Configuration for Microsoft Active Directory
#
#
# The ULR for the LDAP Server
# The default is 'ldap=://localhost:389/'.
#
java.naming.provider.url=ldap://my.active.directory:389/
#
# The user of the LDAP Server connection
# For example: 'cn=Directory Manager'.
#
java.naming.security.principal=cn=Administrator,cn=users,dc=my,dc=active,dc=directory
#
# The credentials or password of the connection
# For example: 'password'.
#
java.naming.security.credentials=password
#
# 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'.
#
security.ldap.realm.0=intalio:dc=my,dc=active,dc=directory
#
# 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'
#
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=Groups
#
# An LDAP attribute name that identifies an user
# For example: 'uid'.
#Данный аттрибут устанавливаем sAMAccountName, т.к. он является логином, cn нам
#не совсем подходит, т.к. там может содержаться русский язык, который при авторизации
#без "напильника" не принимается
security.ldap.user.id=sAMAccountName
#
# 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=member
#
# 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'.
#В AD роли находятся под аттрибутом member а не uniquemember
security.ldap.role.users=member
#
# 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 groupsOC
# 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.0=userCert:userCertificate
#
# The LDAP attribute names of an user
# Format: 'ldap property:alias'
#PЗдесь нам надо проинициализировать аттрибут sAMAccountName, для использования его #в качестве логина
security.ldap.user.prop.0=sAMAccountName:sAMAccountName
security.ldap.user.prop.1=displayName:cn
security.ldap.user.prop.2=ou
security.ldap.user.prop.3=objectClass:objectclass
security.ldap.user.prop.4=sn
security.ldap.user.prop.5=givenName:givenname
security.ldap.user.prop.6=mail:email
security.ldap.user.prop.7=cn:uid
security.ldap.user.prop.8=street:streetaddress
security.ldap.user.prop.9=roomNumber:roomnumber
security.ldap.user.prop.10=nsrole:nsrole
security.ldap.user.prop.11=nsroledn:nsroledn
#
# The LDAP atrribute names of a role or group
# Format: 'ldap property:alias'
#
security.ldap.role.prop.0=sn:sn
security.ldap.role.prop.1=ou:ou
security.ldap.role.prop.2=objectClass:objectclass
security.ldap.role.prop.3=member:member

Как видно из примера отличия весьма незначительны. Но настроить только ldap.properties недостаточно, т.к. подуровни (sub ou's) ou (organisational unit) будут недоступны, а это означает, что Вы можете работать только с пользователями, находящимися в ou=Users, также Вы не сможете авторизоваться используя sAMAccountName.

2. Обновление библиотек security
После настройки ldap.properties требуется сделать обновление библиотеки, отвечающие за security, скачать их можно отсюда: http://www.intalio.org/public/maven2/org/intalio/security/.

Список требуемых библиотек (Выбирайте желательно последние версии библиотек, на момент публикации последняя версия - 1.0.12):

Затем следует зайти в http://localhost:8080/axis2 -> Administration и проверить версию security-ws-service-x.x.xx. См. рисунок ниже.
Скорее всего Вы там увидите security-ws-service-1.0.4. Для того, чтобы обновить версию, Вам следует:
1. Удалить из папки [intalio_server]/webapps/axis2/WEB-INF/services файл security-ws-service-1.0.12.aar.
2. Загрузить новую версию сервиса, как показано на следующем рисунке:
3. Нужно обновить библиотеки security в UI-FW
Для обновления библиотек необходимо скопировать ранее скачанные файлы:
- security-api-1.0.12.jar
- security-web-nutsNbolts-1.0.12.jar
- security-ws-client-1.0.12.jar
- security-ws-common-1.0.12.jar
в папку [intalio_server]\webapps\ui-fw\WEB-INF\lib, затем старые версии библиотек требуется удалить.

4. Нужно обновить библиотеки security в BPMS-CONSOLE
Для обновления библиотек необходимо скопировать ранее скачанные файлы:
- security-api-1.0.12.jar
- security-web-nutsNbolts-1.0.12.jar
- security-ws-client-1.0.12.jar
- security-ws-common-1.0.12.jar
в папку [intalio_server]\webapps\bpms-console\WEB-INF\lib, затем старые версии библиотек требуется удалить.


5. Нужно обновить библиотеки security в GI
Для обновления библиотек необходимо скопировать ранее скачанные файлы:
- security-web-nutsNbolts-1.0.12.jar
в папку [intalio_server]\webapps\gi\WEB-INF\lib, затем старые версии библиотек требуется удалить.

5. Нужно обновить библиотеки security в WDS
Для обновления библиотек необходимо скопировать ранее скачанные файлы:
- security-api-1.0.12.jar
- security-web-nutsNbolts-1.0.12.jar
- security-ws-client-1.0.12.jar
- security-ws-common-1.0.12.jar
в папку [intalio_server]\webapps\wds\WEB-INF\lib, затем старые версии библиотек требуется удалить.

Теперь перезагружаем Intalio|Server и можем использовать Microsoft Active Directory.

Эту статью Вы можете прочитать на новом блоге 

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

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

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