Package ghidra.framework.client
Class PasswordClientAuthenticator
java.lang.Object
ghidra.framework.client.PasswordClientAuthenticator
- All Implemented Interfaces:
ClientAuthenticator
,KeyStorePasswordProvider
PasswordClientAuthenticator
provides a fixed username/password
authentication response when connecting to any Ghidra Server or accessing
a protected PKI keystore. The use of this authenticator is intended for
headless applications in which the user is unable to respond to such
prompts. SSH authentication is not currently supported. Anonymous user
access is not supported.
If a PKI certificate has been installed, a password may be required to access the certificate keystore independent of any other password which may be required for accessing SSH keys or server password authentication. In such headless situations, the PKI certificate path/password should be specified via a property since it is unlikely that the same password will apply.
- See Also:
-
Constructor Summary
ConstructorDescriptionPasswordClientAuthenticator
(String password) PasswordClientAuthenticator
(String username, String password) -
Method Summary
Modifier and TypeMethodDescriptionGet a standard Java authenticator for HTTP and other standard network connectionschar[]
getKeyStorePassword
(String keystorePath, boolean passwordError) Requests password for keystore filechar[]
getNewPassword
(Component parent, String serverInfo, String user) Get new user passwordboolean
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
-
Constructor Details
-
PasswordClientAuthenticator
-
PasswordClientAuthenticator
-
-
Method Details
-
getAuthenticator
Description copied from interface:ClientAuthenticator
Get a standard Java authenticator for HTTP and other standard network connections- Specified by:
getAuthenticator
in interfaceClientAuthenticator
- Returns:
- authenticator object
-
isSSHKeyAvailable
public boolean isSSHKeyAvailable()- Specified by:
isSSHKeyAvailable
in interfaceClientAuthenticator
- 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 interfaceClientAuthenticator
- Parameters:
serverName
- name of servernameCb
- 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:
-
getNewPassword
Description copied from interface:ClientAuthenticator
Get new user password- Specified by:
getNewPassword
in interfaceClientAuthenticator
- Parameters:
parent
- dialog parent component or null if not applicableserverInfo
- server host infouser
-- Returns:
- new password or null if password should not be changed, if not null array will be cleared by caller
-
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 interfaceClientAuthenticator
- Parameters:
title
- password prompt title if GUI is usedserverType
- type of server (label associated with serverName)serverName
- name of servernameCb
- 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:
-
promptForReconnect
Description copied from interface:ClientAuthenticator
Prompt user for reconnect- Specified by:
promptForReconnect
in interfaceClientAuthenticator
- Parameters:
parent
- dialog parent component or null if not applicablemessage
-- Returns:
- return true if reconnect should be attempted
-
getKeyStorePassword
Description copied from interface:KeyStorePasswordProvider
Requests password for keystore file- Specified by:
getKeyStorePassword
in interfaceKeyStorePasswordProvider
- Parameters:
keystorePath
- keystore file pathpasswordError
- if true this is a repeated prompt due to a password use failure- Returns:
- password or null, if not null caller will clear array when no longer needed.
-