Package ghidra.framework.client

# Class DefaultClientAuthenticator

java.lang.Object
docking.widgets.PopupKeyStorePasswordProvider
ghidra.framework.client.DefaultClientAuthenticator

All Implemented Interfaces:
  `ClientAuthenticator`, `KeyStorePasswordProvider`

public class DefaultClientAuthenticator extends PopupKeyStorePasswordProvider implements ClientAuthenticator

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultClientAuthenticator()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Authenticator`
  `getAuthenticator()`
  Get a standard Java authenticator for HTTP and other standard network connections
  `char[]`
  `getNewPassword(Component parent, String serverInfo, String username)`
  Get new user password
  `boolean`
  `isSSHKeyAvailable()`
  `boolean`
  `processPasswordCallbacks(String title, String serverType, String serverName, NameCallback nameCb, PasswordCallback passCb, ChoiceCallback choiceCb, AnonymousCallback anonymousCb, String loginError)`
  Process Ghidra Server password authentication callbacks.
  `boolean`
  `processSSHSignatureCallbacks(String serverName, NameCallback nameCb, SSHSignatureCallback sshCb)`
  Process Ghidra Server SSH authentication callbacks.
  `boolean`
  `promptForReconnect(Component parent, String message)`
  Prompt user for reconnect

  ### Methods inherited from class docking.widgets.PopupKeyStorePasswordProvider

  `getKeyStorePassword`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface ghidra.security.KeyStorePasswordProvider

  `getKeyStorePassword`

- ## Constructor Details

  - ### DefaultClientAuthenticator

    public DefaultClientAuthenticator()

- ## Method Details

  - ### getAuthenticator

    public Authenticator getAuthenticator()
    Description copied from interface: `ClientAuthenticator`
    Get a standard Java authenticator for HTTP and other standard network connections
    Specified by:
      `getAuthenticator` in interface `ClientAuthenticator`
    Returns:
      authenticator object

  - ### isSSHKeyAvailable

    public boolean isSSHKeyAvailable()
    Specified by:
      `isSSHKeyAvailable` in interface `ClientAuthenticator`
    Returns:
      true if SSH private key is available for authentication

  - ### processSSHSignatureCallbacks

    public boolean processSSHSignatureCallbacks(String serverName, NameCallback nameCb, SSHSignatureCallback sshCb)
    Description copied from interface: `ClientAuthenticator`
    Process Ghidra Server SSH authentication callbacks.
    Specified by:
      `processSSHSignatureCallbacks` in interface `ClientAuthenticator`
    Parameters:
      `serverName` - name of server
      `nameCb` - provides storage for user login name. A null indicates that the default user name will be used, @see ClientUtil#getUserName().
      `sshCb` - provides authentication token to be signed with private key, @see SSHAuthenticationCallback#sign(SSHPrivateKey)
    Returns:

  - ### processPasswordCallbacks

    public boolean processPasswordCallbacks(String title, String serverType, String serverName, NameCallback nameCb, PasswordCallback passCb, ChoiceCallback choiceCb, AnonymousCallback anonymousCb, String loginError)
    Description copied from interface: `ClientAuthenticator`
    Process Ghidra Server password authentication callbacks.
    Specified by:
      `processPasswordCallbacks` in interface `ClientAuthenticator`
    Parameters:
      `title` - password prompt title if GUI is used
      `serverType` - type of server (label associated with serverName)
      `serverName` - name of server
      `nameCb` - provides storage for user login name. A null indicates that the default user name will be used, @see ClientUtil#getUserName()
      `passCb` - provides storage for user password, @see PasswordCallback#setPassword(char[])
      `choiceCb` - specifies choice between NT Domain authentication (index=0) and local password file authentication (index=1). Set selected index to specify authenticator to be used,
      `anonymousCb` - may be used to request anonymous read-only access to the server. A null is specified if anonymous access has not been enabed on the server.
      `loginError` - previous login error message or null for first attempt
    Returns:
      true if password provided, false if entry cancelled
    See Also:
      - `A null is specified if no choice is available (password authenticator determined by server configuration).`
      - `AnonymousCallback.setAnonymousAccessRequested(boolean)`

  - ### promptForReconnect

    public boolean promptForReconnect(Component parent, String message)
    Description copied from interface: `ClientAuthenticator`
    Prompt user for reconnect
    Specified by:
      `promptForReconnect` in interface `ClientAuthenticator`
    Parameters:
      `parent` - dialog parent component or null if not applicable
    Returns:
      return true if reconnect should be attempted

  - ### getNewPassword

    public char[] getNewPassword(Component parent, String serverInfo, String username)
    Description copied from interface: `ClientAuthenticator`
    Get new user password
    Specified by:
      `getNewPassword` in interface `ClientAuthenticator`
    Parameters:
      `parent` - dialog parent component or null if not applicable
      `serverInfo` - server host info
    Returns:
      new password or null if password should not be changed, if not null array will be cleared by caller