Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEC-2153: Can't configure port of ldap-server of security namespace with a property : xml schema require a "xs:positiveInteger" #2378

Open
spring-projects-issues opened this issue Mar 25, 2013 · 1 comment
Labels
in: config An issue in spring-security-config in: ldap An issue in spring-security-ldap type: enhancement A general enhancement type: jira An issue that was migrated from JIRA

Comments

@spring-projects-issues
Copy link

Julien Graglia (Migrated from SEC-2153) said:

I cannot use a property to configure the port of the embeded LDAP server start by the "ldap-server" element of the security namespace.

It fail on XML validation as port is required to be an "xs:positiveInteger".

Note that org.springframework.security.config.ldap.LdapServerBeanDefinitionParser lookup port attribute as a ... String!

I heading to create 2 profiles to use a different port, and activate the profile with the "spring.profiles.active" property.

@spring-projects-issues
Copy link
Author

Julien Graglia said:

Note : the workaround by using 2 profiles is ok.... but real problem was to be able to launch an ldap server from a main, and also in my unit tests.
With
System.setProperty("spring.profiles.active", "main");
in the main, and
@activeprofiles("unittest")
in the unit test, I can choose the right profile to activate :

<security:ldap-server root="o=mojo" ldif="classpath:test.ldif"
manager-dn="cn=manager" manager-password="netc" port="8389" />


<security:ldap-server root="o=mojo" ldif="classpath:test.ldif"
manager-dn="cn=manager" manager-password="netc" port="9389" />

But I still can run main, then unit test as the 2 process share the same temp folder. look at ApacheDSContainer#afterPropertiesSet and use the apacheDSWorkDir systemp property to change it!

@spring-projects-issues spring-projects-issues added in: ldap An issue in spring-security-ldap Namespace type: enhancement A general enhancement type: jira An issue that was migrated from JIRA labels Feb 5, 2016
@rwinch rwinch added in: config An issue in spring-security-config and removed Namespace labels May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: config An issue in spring-security-config in: ldap An issue in spring-security-ldap type: enhancement A general enhancement type: jira An issue that was migrated from JIRA
Projects
None yet
Development

No branches or pull requests

2 participants