Skip to content

Commit

Permalink
Bug 37544727 - LoginModule should allow user to provide keystore pass…
Browse files Browse the repository at this point in the history
…word from callback handler, simplify test handler (14.1.1.0 cl 114247 --> 14.1.1.0 CE)

[git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v14.1.1.0/": change = 114271]
  • Loading branch information
fryp committed Feb 10, 2025
1 parent a4d7b54 commit 40afa8f
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@

import com.tangosol.net.PasswordProvider;

import com.tangosol.util.Base;
import com.tangosol.util.ClassHelper;
import com.tangosol.util.ExternalizableHelper;

import java.security.Principal;

import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.ConfirmationCallback;
Expand All @@ -27,20 +24,20 @@

/**
* The HandlerPasswordProvider is a CallbackHandler implementation
* based on a specified username and a password provider. A file based
* password provider, FileBasedPasswordProvider, is used.
* based on a specified username and a password provider. For the
* password provider, a file based password provider,
* FileBasedPasswordProvider, is used.
*
* @author lh, jk 2025.02.04
* @since Coherence 14.1.2.0.2
*/
public class HandlerPasswordProvider
extends Base
implements CallbackHandler, Principal
implements CallbackHandler
{
// ----- constructors ---------------------------------------------------

/**
* Construct a SimpleHandler.
* Construct a HandlerPasswordProvider.
*
* @param sName the username
* @param sClass the password provider class name
Expand Down Expand Up @@ -94,7 +91,10 @@ public void handle(Callback[] aCallback)
}
else if (callback instanceof PasswordCallback)
{
((PasswordCallback) callback).setPassword(m_provider.get());
if (m_provider != null)
{
((PasswordCallback) callback).setPassword(m_provider.get());
}
}
else if (callback instanceof TextOutputCallback ||
callback instanceof ConfirmationCallback)
Expand Down Expand Up @@ -125,7 +125,7 @@ else if (callback instanceof TextOutputCallback ||
public boolean equals(Object o)
{
return o instanceof HandlerPasswordProvider ?
equals(m_sName, ((HandlerPasswordProvider) o).m_sName) : false;
m_sName.equals(((HandlerPasswordProvider) o).m_sName) : false;
}

/**
Expand Down

0 comments on commit 40afa8f

Please sign in to comment.