AnsweredAssumed Answered

Kerberos cross domain auth fails with KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN

Question asked by betawayoflife on Dec 22, 2016
Latest reply on Jan 11, 2017 by betawayoflife

Hi guys,

 

i've a problem authenticating kerberos with multiple domains.

I'm using Alfresco 4.2f on Windows Server 2012 R2 and i've a forest trust (function level 2008 r2) between two domains.

 

My kerberos cross domain setup is like in the word document from here:
[MNT-10368] support for cross-domain kerberos authentication - Alfresco JIRA 

or this guide Configuring cross-domain support for Kerberos | Alfresco Documentation

 

The problem is, i'm able to login fine with users from my main domain, but not with users from my second domain.

 

I've traced the krb5 packages with wireshark and if i try to login from the second domain i get following package:

"KRB5 Error: KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN".

In this package i can see that the user from the second domain tries to authenticate with the realm from the main domain.


The problem is exactly the same as here (without answer): Kerberos with multiple domains on Share 4.0.d 

 

Here is my authentication part from alfresco-global.properties):

 

ldap.authentication.defaultAdministratorUserNames=alfrescoadmin
kerberos.authentication.defaultAdministratorUserNames=alfrescoadmin
authentication.chain=kerberos1:kerberos,ldap-domain1:ldap-ad,ldap-domain2:ldap-ad

Here is my krb5.ini:

 

[libdefaults]
default_realm = DOMAIN1.LOC
dns_lookup_realm = false
dns_lookup_kdc = false
ticket_lifetime = 2h
default_tkt_enctypes = rc4-hmac
default_tgs_enctypes = rc4-hmac

[realms]
DOMAIN1.LOC = {
kdc = dc01.domain1.loc:88
admin_server = dc01.domain1.loc:749
default_domain = domain1.loc
}
DOMAIN2.LOC = {
kdc = dc01.domain2.loc:88
admin_server = dc01.domain2.loc:749
default_domain = domain2.loc
}

[domain_realm]
dc01.domain1.loc = DOMAIN1.LOC
.dc01.domain1.loc = DOMAIN1.LOC
dc01.domain2.loc = DOMAIN2.LOC
.dc01.domain2.loc = DOMAIN2.LOC

 

Here is my kerberos subsystem config:

 

ntlm.authentication.sso.enabled=true
kerberos.authentication.realm=DOMAIN1.LOC
kerberos.authentication.sso.enabled=true
kerberos.authentication.user.configEntryName=Alfresco
kerberos.authentication.http.configEntryName=AlfrescoHTTP
kerberos.authentication.http.password=HighSecure
kerberos.authentication.authenticateCIFS=false
kerberos.authentication.browser.ticketLogons=true

Here is my java.login.config:

 

Alfresco {
com.sun.security.auth.module.Krb5LoginModule sufficient;
};
AlfrescoHTTP {
com.sun.security.auth.module.Krb5LoginModule required
storeKey=true
useKeyTab=true
keyTab="C:/etc/alfrescohttp.keytab"
principal="HTTP/ecm01.domain1.loc";
};
com.sun.net.ssl.client {
com.sun.security.auth.module.Krb5LoginModule sufficient;
};
other {
com.sun.security.auth.module.Krb5LoginModule sufficient;
};

 

Here is the changed part from java.security:

 

login.config.url.1=file:${java.home}/lib/security/java.login.config

 

And finaly the LDAP part for both domains:

 

ldap.authentication.active=false 
ldap.synchronization.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://dc01.domain1.loc:389

# The authentication mechanism to use
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

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

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

# 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

# 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\=group)

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

# The query to select objects that represent the users to import that have changed since a certain time.
ldap.synchronization.personDifferentialQuery=(objectclass\=user)

# The group search base restricts the LDAP group query to a sub section of tree on the LDAP server.
ldap.synchronization.groupSearchBase=dc=domain1,dc=loc

# The user search base restricts the LDAP user query to a sub section of tree on the LDAP server.
ldap.synchronization.userSearchBase=dc=domain1,dc=loc

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

# 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=userHomeFolderProvider

# The attribute on LDAP group objects to map to the gid property in Alfrecso
ldap.synchronization.groupIdAttributeName=cn

# 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

 

ldap.authentication.active=false 
ldap.synchronization.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://dc01.domain2.loc:389

# The authentication mechanism to use
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

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

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

# 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

# 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\=group)

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

# The query to select objects that represent the users to import that have changed since a certain time.
ldap.synchronization.personDifferentialQuery=(objectclass\=user)

# The group search base restricts the LDAP group query to a sub section of tree on the LDAP server.
ldap.synchronization.groupSearchBase=dc=domain2,dc=loc

# The user search base restricts the LDAP user query to a sub section of tree on the LDAP server.
ldap.synchronization.userSearchBase=dc=domain2,dc=loc

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

# 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=userHomeFolderProvider

# The attribute on LDAP group objects to map to the gid property in Alfrecso
ldap.synchronization.groupIdAttributeName=cn

# 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

 

Hopefully anyone can bring me in the right direction.


Thanks.


Beta

Outcomes