# This is a sample configuration file for TeamCity LDAP integration
# To make it effective, copy it to ldap-config.properties file
# This file is overwritten with default content on each server startup.
# See documentation at http://www.jetbrains.net/confluence/display/TCD4/LDAP+Integration


### MANDATORY SETTINGS ###

# The url(s) of LDAP server.
# Example:  java.naming.provider.url=ldap://example.com:389/DC=Example,DC=Com
java.naming.provider.url=LDAP://CODC01.idtdna.com:389/CN=User%20Accounts,DC=IDTDNA,DC=COM


### OPTIONAL SETTINGS ###

# Regular expression that all user-entered login names should match. Login will be denied if user enters non-matching name on login form.
# Do not forget to escape the vlaue: http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#load(java.io.InputStream)
# default is (all names that do not contain "\" and "@"
#teamcity.auth.loginFilter=[^/\\\\@]+
# to allow any name, use
#teamcity.auth.loginFilter=.*

# A transformation that will be applied to the user-entered login name before performing LDAP bind.
# User-entered login name can be referenced by "$login$".
# By default, no transformation is applied.
teamcity.auth.formatDN=$login$@idtdna.com
# Example:
#teamcity.auth.formatDN=UID=$login$,DC=Example,DC=Com


### USERNAME TRANSFORMATION SETTINGS ###

# A pattern that will be used to capture TeamCity username from user-entered login name.
# If "teamcity.users.login.filter" is not set, the captured login will be stored as user's TeamCity username.
# The pattern is a regular expression. The first matched group of the pattern will be used as username.
# Exaple: store "JSmith" if user entered EXAMPLE\JSmith
#teamcity.users.login.capture=EXAMPLE\\\\(.*)

# LDAP filter string to search for LDAP entry corresponding to the user based on user-entered login name.
# The search is performed inside the LDAP entry denoted by "teamcity.users.base".
# User-entered login name can be referenced by "$login$".
# Captured (teamcity.auth.captureLogin) login name can be referenced by "$capturedLogin$"
# The TeamCity username is then retrieved using attribute defined by "teamcity.users.username".
# Make sure "teamcity.users.base" and "teamcity.users.username" are defined together with "teamcity.users.login.filter"
#teamcity.users.login.filter=(cn=$capturedLogin$)

# A transformation that will be used to get previous TeamCity username of the user that is logging in
# User-entered login name can be referenced by "$login$".
# Captured (teamcity.auth.captureLogin) login name can be referenced by "$capturedLogin$"
# New user username can be referenced by "$username$"
#teamcity.users.previousUsername=EXAMPLE\\$login$

# Additional Java Naming options
java.naming.referral=follow
java.naming.security.authentication=simple

####################################################################################################
# LDAP SYNCHRONIZATION
####################################################################################################

# Set to "true" to enable the synchronization for user's properties
teamcity.options.users.synchronize=true

# Set to "true" to enable the synchronization for user's groups
teamcity.options.groups.synchronize=true

# Set to "true" to enable automatic user creation and deletion during the synchronization.
teamcity.options.createUsers=true
teamcity.options.deleteUsers=true

# The time interval between synchronizations (in milliseconds). By default, it is one hour.
teamcity.options.syncTimeout = 3600000


### MANDATORY SETTINGS ###

# The credentials to use when browsing LDAP for synchronization purposes.
# The user must have read access to all LDAP entries under 'teamcity.users.base' and 'teamcity.groups.base' (see below).
java.naming.security.principal=XXXXXXXXXXX
java.naming.security.credentials=XXXXXXXXXXX

# The user base DN. Users are retrieved only from the LDAP subtree denoted by this DN.
teamcity.users.base=OU=Coralville,OU=IS,OU=Application Development

# The user search filter.
# LDAP filter string to search for all users.
teamcity.users.filter=(objectClass=user)
#(&(objectCategory=Person)(memberOf:1.2.840.113556.1.4.1941:=CN=SG_Development,OU=Security Groups,OU=Exchange,OU=Groups,DC=idtdna,DC=com))

# The name of LDAP attribute that will be used to match LDAp entries with TeamCity users.
# The value of the attribute should match the username stored in TeamCity
teamcity.users.username=sAMAccountName


### GROUPS SETTINGS ###
# These settings are mandatory if groups synchronization is turned on (ldap-mapping.xml exists)

# The groups base DN. Groups are retrieved from the LDAP subtree denoted by this DN.
teamcity.groups.base=OU=Security Groups,OU=Exchange,OU=Groups,DC=idtdna,DC=com

# The group search filter.
# LDAP filter string to search for all groups.
teamcity.groups.filter=(objectClass=group)

# The attribute that indicates the member of the group
teamcity.groups.property.member=member


### OPTIONAL USER SETTINGS ###

# The name of LDAP attribute to retrieve user's full name
teamcity.users.property.displayName=displayName

# The name of LDAP attribute to retrieve user's email
teamcity.users.property.email=mail

# The names of LDAP attribute to set user's properties
#teamcity.users.property.<teamcity-user-property-name>=<LDAP attribute>
# e.g. to retrieve user's Jabber account from LDAP attribute "jabberAccount", use:
#teamcity.users.property.plugin\:notificator\:jabber\:jabber-account=jabberAccount
# to retrieve user's VCS username from LDAP attribute, use:
#teamcity.users.property.plugin\:vcs\:svn\:anyVcsRootnotificator=<LDAP attribute username>
#teamcity.users.property.plugin\:vcs\:perforce\:anyVcsRootnotificator=<LDAP attribute username>
#teamcity.users.property.plugin\:vcs\:cvs\:anyVcsRootnotificator=<LDAP attribute username>
#teamcity.users.property.plugin\:vcs\:tfs\:anyVcsRootnotificator=<LDAP attribute username>
#teamcity.users.property.plugin\:vcs\:vss\:anyVcsRootnotificator=<LDAP attribute username>
#teamcity.users.property.plugin\:vcs\:clearcase\:anyVcsRootnotificator=<LDAP attribute username>
#teamcity.users.property.plugin\:vcs\:starteam\:anyVcsRootnotificator=<LDAP attribute username>
