Skip to content

Default LDIF file not picked up in LDAP "unboundid" mode #7833

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

Closed
eleftherias opened this issue Jan 15, 2020 · 1 comment · Fixed by #7850
Closed

Default LDIF file not picked up in LDAP "unboundid" mode #7833

eleftherias opened this issue Jan 15, 2020 · 1 comment · Fixed by #7850
Assignees
Labels
in: ldap An issue in spring-security-ldap status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@eleftherias
Copy link
Contributor

Summary

When using LDAP, if a file matching "*.ldif" exists on the classpath, then it should be used, if no other LDIF file is specified.
However, when using "unboundid" mode, the file on the classpath is not picked up unless explicitly specified.

Sample

This issue can be demonstrated using the LDAP sample with a few modifications.
Firstly, to make the application use "unboundid" mode, replace runtime apachedsDependencies with compile "com.unboundid:unboundid-ldapsdk" in the gradle file.
Then, remove ldif="classpath:users.ldif" from the s:ldap-server element.
The integration tests will fail.

@eleftherias eleftherias added in: ldap An issue in spring-security-ldap type: bug A general bug labels Jan 15, 2020
@eleftherias
Copy link
Contributor Author

This issue occurs because UnboundIdContainer gets the LDIF file using

this.context.getResource(this.ldif)

which expects the resource name to be prefixed with "classpath:".

However, the default LDIF file used is "classpath*:*.ldif" which indicates that multiple resources are expected.

A possible solution is to use getResources instead, in UnboundIdContainer, similarly to ApacheDSContainer

@eleftherias eleftherias self-assigned this Jan 20, 2020
eleftherias added a commit to eleftherias/spring-security that referenced this issue Jan 20, 2020
rwinch pushed a commit that referenced this issue Jan 21, 2020
@eleftherias eleftherias added this to the 5.3.0.RC1 milestone Jan 21, 2020
@spring-projects-issues spring-projects-issues added the status: backported An issue that has been backported to maintenance branches label Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: ldap An issue in spring-security-ldap status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants