spring-projects / spring-projects/spring-ldap

doGetContext should use returned DirContext processContextAfterCreation

Open
#412 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
375
Forks
501
Avg merge
6h 4m
Merged PRs (30d)
63

Description

to enable the startTLS to close the session.

One may want to use a org.springframework.ldap.core.support.AbstractTlsDirContextAuthenticationStrategy as authenticationStrategy, and set its shutdownTlsGracefully flag to true.
Now, calling authenticationStrategy.processContextAfterCreation from doGetContext should return a proxy DirContext which will hold
a TlsAwareDirContextProxy with the ldap context he had opend. calling to 'close' of the contex whould now call also to 'close' of the ldap context.
(This is needed when using ldap protocol with startTls. Some configurations reqiers the caller to shutdown Tls gracefully)
The returned DirContext proxy is now the one to be returned from doGetContext, and not ignored as before.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at doGetContext and trace how authenticationStrategy.processContextAfterCreation is currently called, using AbstractTlsDirContextAuthenticationStrategy and TlsAwareDirContextProxy as the relevant types. Done means the returned proxy DirContext is propagated from doGetContext so closing it also closes the LDAP context for graceful StartTLS shutdown.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
authentication, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.