diff --git a/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/AuthMechConfig.java b/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/AuthMechConfig.java index 310cd797..6d08dd58 100644 --- a/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/AuthMechConfig.java +++ b/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/AuthMechConfig.java @@ -133,6 +133,7 @@ public class AuthMechConfig // Proceed based on our state switch (m_state) { + case AWAITING_SETTING_ELEMENT_DATA: case AWAITING_SETTING_ELEMENT_END: // Advance to the next state m_state = AWAITING_SETTING_ELEMENT_START; diff --git a/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/AuthTokenConfig.java b/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/AuthTokenConfig.java index 066be707..27d40aa3 100644 --- a/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/AuthTokenConfig.java +++ b/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/AuthTokenConfig.java @@ -138,6 +138,7 @@ public class AuthTokenConfig // Proceed based on our state switch (m_state) { + case AWAITING_SETTING_ELEMENT_DATA: case AWAITING_SETTING_ELEMENT_END: // Advance to the next state m_state = AWAITING_SETTING_ELEMENT_START; diff --git a/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/IdenTokenConfig.java b/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/IdenTokenConfig.java index aa3ce49b..d1b77f29 100644 --- a/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/IdenTokenConfig.java +++ b/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/IdenTokenConfig.java @@ -137,6 +137,7 @@ public class IdenTokenConfig // Proceed based on our state switch (m_state) { + case AWAITING_SETTING_ELEMENT_DATA: case AWAITING_SETTING_ELEMENT_END: // Advance to the next state m_state = AWAITING_SETTING_ELEMENT_START; diff --git a/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/Krb5Authenticate.java b/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/Krb5Authenticate.java index 9c2b7369..5b02178e 100644 --- a/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/Krb5Authenticate.java +++ b/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/Krb5Authenticate.java @@ -198,11 +198,22 @@ public class Krb5Authenticate implements AuthMechanism, Serializable DirContext ctx = new InitialDirContext(env); - // Now search for a user with a matching kerberos principal name + // Now search for a user with a matching kerberos principal name. + // + // Set up a search control so that the search is scoped to the sub-tree SearchControls controls = new SearchControls(); controls.setSearchScope(SearchControls.SUBTREE_SCOPE); - NamingEnumeration answer = ctx.search(m_svcConfig.getSetting(SvcConfig.StartSearchContext), + // Obtain the start search context - tbd - this will be removed once the functionality flows into Bandit + String searchContext = m_svcConfig.getSetting(SvcConfig.StartSearchContext); + if (searchContext == null) + { + // A start search context was not configured, start from the root. + searchContext = ""; + } + + // Perform the search + NamingEnumeration answer = ctx.search(searchContext, "(krbPrincipalName={0})", new String[] {krb5Token.getPrincipalName()}, controls); diff --git a/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/PwdAuthenticate.java b/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/PwdAuthenticate.java index 35ef194c..5cb2804c 100644 --- a/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/PwdAuthenticate.java +++ b/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/PwdAuthenticate.java @@ -143,11 +143,22 @@ public class PwdAuthenticate implements AuthMechanism, Serializable DirContext ctx = new InitialDirContext(env); - // Now search for a user with a matching surname + // Now search for a user with a matching surname. + // + // Set up a search control so that the search is scoped to the sub-tree SearchControls controls = new SearchControls(); controls.setSearchScope(SearchControls.SUBTREE_SCOPE); - NamingEnumeration answer = ctx.search(m_svcConfig.getSetting(SvcConfig.StartSearchContext), + // Obtain the start search context - tbd - this will be removed once the functionality flows into Bandit + String searchContext = m_svcConfig.getSetting(SvcConfig.StartSearchContext); + if (searchContext == null) + { + // A start search context was not configured, start from the root. + searchContext = ""; + } + + // Perform the search + NamingEnumeration answer = ctx.search(searchContext, "(cn={0})", new String[] {pwToken.getUsername()}, controls); diff --git a/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/SvcConfig.java b/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/SvcConfig.java index 39630987..df111a13 100644 --- a/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/SvcConfig.java +++ b/auth_token/server/AuthTokenSvc/src/com/novell/casa/authtoksvc/SvcConfig.java @@ -146,6 +146,7 @@ public class SvcConfig // Proceed based on our state switch (m_state) { + case AWAITING_SETTING_ELEMENT_DATA: case AWAITING_SETTING_ELEMENT_END: // Advance to the next state m_state = AWAITING_SETTING_ELEMENT_START; @@ -273,11 +274,6 @@ public class SvcConfig System.err.println("SvcConfig.getSetting()- Mandatory setting " + IdentityAbstractionConfigFile + " not set"); throw new Exception("Missing mandatory configuration setting"); } - else if (settingName.equals(StartSearchContext) == true) - { - System.err.println("SvcConfig.getSetting()- Mandatory setting " + StartSearchContext + " not set"); - throw new Exception("Missing mandatory configuration setting"); - } } else { diff --git a/auth_token/server/AuthTokenSvc/svc.settings b/auth_token/server/AuthTokenSvc/svc.settings index c58c30fa..bfa391e9 100644 --- a/auth_token/server/AuthTokenSvc/svc.settings +++ b/auth_token/server/AuthTokenSvc/svc.settings @@ -1,6 +1,5 @@ Replace with path to the Identity Abstraction Realms Configuration File. -Replace with the Context from where to start searches, do not specify to start at the root. 43200