cancel
Showing results for 
Search instead for 
Did you mean: 

ldap-ad authentication and unusual UPN

boiss007
Champ on-the-rise
Champ on-the-rise
Hello, people

I have a little problem, and i'd like to ask from help.

I'm in the process to deploy Alfresco 5 for a client and I am stuck on the authentication part.

Let me explain : I have already configure my authentication but the client use a strange ADuser format :

for a user <em>"bob strange"</em> in the domain <em>"myfirm.fr"</em> (and not myfirm.local or myfirm.domain)
The SAMAccountName is <em>b.strange</em>
The UPN is <em>bobstrange@myfirm.fr</em>
The mail domain is the same as the AD domain so the mail is <em>bobstrange@myfirm.fr</em> (same as UPN)

I guess they choosed to format the UPN to mimic the mail (contrary to the usual form where the mail mimic the UPN)

for the windows session everyone use the old windows login format => <strong>domain\sammaccountname</strong>
for the exchange sessions (OWA) they use the UPN but only 1/3 of the users have a mail so they don't want to use it for alfresco because many users are not used to the UPN

Now alfresco is great at getting the UPN but i need to use the SAMAccountName for the authentication and it is not IN the UPN
So right now, they can login with the prefix of the UPN (something like "bobstrange") and they want to login with the SAMAccountName ("b.strange")

I would love to fix this problem without having to modify the .java classes (it complicates the future evolution), so if someone has a better idea, please, share your wisdom…

PS : my configuration of the ldap-ad subsystem is fine, my only concern is getting the AD SAMAccountName attribute in ldap.authentication.userNameFormat instead of the UPN attribute
4 REPLIES 4

borisstankov
Champ in-the-making
Champ in-the-making
What are your ldap properties in the property file? Please post them here. Smiley Happy

Hello and thanks for answering boris.
So as said, the ldap connexion is already working but here are my config files

in alfresco-global.properties :

### Authentication Chain
authentication.chain=alfinst:alfrescoNtlm,GLOBAL:ldap-ad,01-AE:ldap-ad,02-DE:ldap-ad


in <TOMCAT_HOME>/shares/classes/alfresco/extension/subsystems/Authentication/ldap-ad/GLOBAL/ldap-ad-authentication.properties

# This flag enables use of this LDAP subsystem for authentication. It may be
# that this subsytem should only be used for synchronization, in which case
# this flag should be set to false.
ldap.authentication.active=true

#
# This properties file brings together the common options for LDAP authentication rather than editing the bean definitions
#
ldap.authentication.allowGuestLogin=false

# How to map the user id entered by the user to taht passed through to LDAP
# In Active Directory, this can either be the user principal name (UPN) or DN.
# UPNs are in the form <sAMAccountName>@domain and are held in the userPrincipalName attribute of a user
ldap.authentication.userNameFormat=%s

# The LDAP context factory to use
ldap.authentication.java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory

# The URL to connect to the LDAP server
ldap.authentication.java.naming.provider.url=ldap://AD-Server

#Custom Socket Factory.
#ldap.java.naming.ldap.factory.socket=org.alfresco.repo.security.authentication.ldap.AlfrescoLdapSSLSocketFactory

# The authentication mechanism to use for password validation
ldap.authentication.java.naming.security.authentication=simple

# Escape commas entered by the user at bind time
# Useful when using simple authentication and the CN is part of the DN and contains commas
ldap.authentication.escapeCommasInBind=false

# Escape commas entered by the user when setting the authenticated user
# Useful when using simple authentication and the CN is part of the DN and contains commas, and the escaped \, is
# pulled in as part of an LDAP sync
# If this option is set to true it will break the default home folder provider as space names can not contain \
ldap.authentication.escapeCommasInUid=false

# Comma separated list of user names who should be considered administrators by default
ldap.authentication.defaultAdministratorUserNames=Administrator

# Enable FTP authentication using LDAP
ldap.authentication.authenticateFTP=true

# This flag enables use of this LDAP subsystem for user and group
# synchronization. It may be that this subsytem should only be used for
# authentication, in which case this flag should be set to false.
ldap.synchronization.active=true

# The authentication mechanism to use for synchronization
ldap.synchronization.java.naming.security.authentication=simple

# The default principal to bind with (only used for LDAP sync). This should be a UPN or DN
ldap.synchronization.java.naming.security.principal=mySyncUser

# The password for the default principal (only used for LDAP sync)
ldap.synchronization.java.naming.security.credentials=password

# If positive, this property indicates that RFC 2696 paged results should be
# used to split query results into batches of the specified size. This
# overcomes any size limits imposed by the LDAP server.
ldap.synchronization.queryBatchSize=1000

# If positive, this property indicates that range retrieval should be used to fetch
# multi-valued attributes (such as member) in batches of the specified size.
# Overcomes any size limits imposed by Active Directory.       
ldap.synchronization.attributeBatchSize=1000

# The query to select all objects that represent the groups to import.
ldap.synchronization.groupQuery=(objectclass\=group)

# The query to select objects that represent the groups to import that have changed since a certain time.
ldap.synchronization.groupDifferentialQuery=(&(objectclass\=organizational-unit)(!(whenChanged<\={0})))

# The query to select all objects that represent the users to import.
ldap.synchronization.personQuery=(&(objectclass\=user)(userAccountControl\:1.2.840.113556.1.4.803\:\=512))

# The query to select objects that represent the users to import that have changed since a certain time.
ldap.synchronization.personDifferentialQuery=(&(objectclass\=user)(userAccountControl\:1.2.840.113556.1.4.803\:\=512)(!(whenChanged<\={0})))

# The group search base restricts the LDAP group query to a sub section of tree on the LDAP server.
#ldap.synchronization.groupSearchBase=ou\=Security Giroups,ou\=Alfresco,dc=domain
ldap.synchronization.groupSearchBase=OU\=someOU,dc\=corps,dc=fr

# The user search base restricts the LDAP user query to a sub section of tree on the LDAP server.
#ldap.synchronization.userSearchBase=ou\=User Accounts,ou=\Alfresco,dc=domain
ldap.synchronization.userSearchBase=OU\=someOU,dc\=corps,dc=fr


# The name of the operational attribute recording the last update time for a group or user.
ldap.synchronization.modifyTimestampAttributeName=whenChanged

# The timestamp format. Unfortunately, this varies between directory servers.
ldap.synchronization.timestampFormat=yyyyMMddHHmmss'.0Z'

# The attribute name on people objects found in LDAP to use as the uid in Alfresco
ldap.synchronization.userIdAttributeName=sAMAccountName

# The attribute on person objects in LDAP to map to the first name property in Alfresco
ldap.synchronization.userFirstNameAttributeName=givenName

# The attribute on person objects in LDAP to map to the last name property in Alfresco
ldap.synchronization.userLastNameAttributeName=sn

# The attribute on person objects in LDAP to map to the email property in Alfresco
ldap.synchronization.userEmailAttributeName=mail

# The attribute on person objects in LDAP to map to the organizational id  property in Alfresco
ldap.synchronization.userOrganizationalIdAttributeName=company

# The default home folder provider to use for people created via LDAP import
ldap.synchronization.defaultHomeFolderProvider=largeHomeFolderProvider

# The attribute on LDAP group objects to map to the authority name property in Alfresco
ldap.synchronization.groupIdAttributeName=cn

# The attribute on LDAP group objects to map to the authority display name property in Alfresco
ldap.synchronization.groupDisplayNameAttributeName=displayName

# The group type in LDAP
ldap.synchronization.groupType=group

# The person type in LDAP
ldap.synchronization.personType=user

# The attribute in LDAP on group objects that defines the DN for its members
ldap.synchronization.groupMemberAttributeName=member

# If true progress estimation is enabled. When enabled, the user query has to be run twice in order to count entries.
ldap.synchronization.enableProgressEstimation=true

# Requests timeout, in miliseconds, use 0 for none (default)
ldap.authentication.java.naming.read.timeout=0

# LDAPS truststore configuration properties
#ldap.authentication.truststore.path=
#ldap.authentication.truststore.passphrase=
#ldap.authentication.truststore.type=
# Set to 'ssl' to enable truststore configuration via subsystem's properties
#ldap.authentication.java.naming.security.protocol=ssl
^


But as mentionned, the problem i have is here :

# How to map the user id entered by the user to taht passed through to LDAP
# In Active Directory, this can either be the user principal name (UPN) or DN.
# UPNs are in the form <sAMAccountName>@domain and are held in the userPrincipalName attribute of a user
ldap.authentication.userNameFormat=%s

because the samaccountname is presumed to be part of the UPN, there doesn't seem to be another way to access it for the authentication…

Hope  it helps clarify, and that it helps you to help me… Because i can see the big changes i'll have to make to the source code if i dont find a "smart" way to pull it off…

HI,

Now is nore clear. But just to be sure if I managed to get into your problem.

If I'm part fo you ldap and let's say that I have useraccount: boris.stankov
And your domain is "example.com".

I want to login to the system with only typing in "boris.stankov" instead of the whole string "boris.stankov@example.com".

So you should specify the property to be:

ldap.authentication.userNameFormat=%s@example.com


Which shoud allow me to login only with "boris.stankov", cause I'm part of the domain.

Here is what I found in this forum, which is similar to your problem. Check the last post, it's old one, but still valid:
https://forums.alfresco.com/forum/installation-upgrades-configuration-integration/configuration/ldap...


Cheers and hope that helps you resolve the problem.

kicktrick
Champ in-the-making
Champ in-the-making
Hi Boiss, did you find a resolution to this? I have a similar problem where I want to use SAMAccountName to authenticate.

Example:

SAMAccountName = jbloggs
UPN = joe.bloggs@example.com

Want user to log into alfresco using jbloggs.

Thanks in advance.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.