public interface Authenticator
This interface allows plugins to ask the user for login information.
Login information can be a password, a username-password combination
and even domain & username & password.
The user has the option to store the entered login information in the Omix security wallet.
The wallet is only enabled if a walletKey or a URL is given.
The user has the option to store the entered login information in the Omix security wallet.
The wallet is only enabled if a walletKey or a URL is given.
IN NO CASE, AN OMIX PLUGIN IS ALLOWED TO STORE THE ENTERED LOGIN INFORMATION PERSISTENTLY OR USE IT FOR OTHER PURPOSES THAN DESCRIBED IN THE DIALOG MESSAGES. VIOLATION OF THIS TERMS MAY BE LIABLE TO PROSECUTION AND LEAD TO TERMINATION OF ANY LICENSE AGREEMENT CONCERNING OMIX BETWEEN THE LICENSER OF OMIX AND THE PLUGIN DEVELOPER.
- Since:
- Omix 1.3.11
- Author:
- Dr. Peter Droste, Omix Visualization
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Authenticator.DomainUsernamePassword
Represents a domain+username/password answer.static class
Authenticator.Password
Represents a password answer.static class
Authenticator.UsernamePassword
Represents a username/password answer. -
Method Summary
Modifier and Type Method Description void
critical(String title, String message)
Shows the given message as error dialog.Authenticator.DomainUsernamePassword
getDomainUsernamePassword(String walletKey, String message)
The same as getDomainUsernamePassword(walletKey, message, false).Authenticator.DomainUsernamePassword
getDomainUsernamePassword(String walletKey, String message, boolean forceOverride)
Prompts for domain/username & password.Authenticator.DomainUsernamePassword
getDomainUsernamePassword(String walletKey, String message, String domain, String username)
The same as getDomainUsernamePassword(walletKey, message, domain, username, false).Authenticator.DomainUsernamePassword
getDomainUsernamePassword(String walletKey, String message, String domain, String username, boolean forceOverride)
Prompts for domain/username & password.Authenticator.DomainUsernamePassword
getDomainUsernamePassword(URL url, String message)
The same as getDomainUsernamePassword(url, message, false).Authenticator.DomainUsernamePassword
getDomainUsernamePassword(URL url, String message, boolean forceOverride)
Prompts for domain/username & password.Authenticator.DomainUsernamePassword
getDomainUsernamePassword(URL url, String message, String domain, String username)
The same as getDomainUsernamePassword(url, message, domain, username, false).Authenticator.DomainUsernamePassword
getDomainUsernamePassword(URL url, String message, String domain, String username, boolean forceOverride)
Prompts for domain/username & password.Authenticator.Password
getPassphrase(String walletKey, String message)
The same as getPassphrase(walletKey, message, false).Authenticator.Password
getPassphrase(String walletKey, String message, boolean forceOverride)
The message describes the purpose.Authenticator.Password
getPassphrase(URL url, String message)
The same as getPassphrase(url, message, false).Authenticator.Password
getPassphrase(URL url, String message, boolean forceOverride)
The message describes the purpose.Authenticator.Password
getPassword(String walletKey, String message)
The same as getPassword(walletKey, message, false).Authenticator.Password
getPassword(String walletKey, String message, boolean forceOverride)
Prompts for a password.Authenticator.Password
getPassword(URL url, String message)
The same as getPassword(url, message, false).Authenticator.Password
getPassword(URL url, String message, boolean forceOverride)
Prompts for a password.Authenticator.UsernamePassword
getUsernamePassword(String walletKey, String message, boolean forceOverride)
Prompts for username & password.Authenticator.UsernamePassword
getUsernamePassword(String walletKey, String message, String username)
The same as getUsernamePassword(walletKey, message, username, false).Authenticator.UsernamePassword
getUsernamePassword(String walletKey, String message, String username, boolean forceOverride)
Prompts for username & password.Authenticator.UsernamePassword
getUsernamePassword(URL url, String message)
The same as getUsernamePassword(url, message, false).Authenticator.UsernamePassword
getUsernamePassword(URL url, String message, boolean forceOverride)
Prompts for username & password.Authenticator.UsernamePassword
getUsernamePassword(URL url, String message, String username)
The same as getUsernamePassword(url, message, username, false).Authenticator.UsernamePassword
getUsernamePassword(URL url, String message, String username, boolean forceOverride)
Prompts for username & password.String[]
input(String title, String message, String[] descriptions, boolean[] echos)
Asks the user to enter N lines whereas N is the number of submitted description texts.void
message(String title, String message)
Shows the given message as information dialog.boolean
question(String title, String question)
Asks a yes/no question.Authenticator.UsernamePassword
readUsernamePassword(String walletKey)
Reads username & password from the wallet without user interaction.Authenticator.UsernamePassword
readUsernamePassword(String walletKey, boolean askForMasterpassword)
Reads username & password from the wallet without user request.void
warning(String title, String message)
Shows the given message as warning dialog.boolean
writeUsernamePassword(String walletKey, String username, byte[] password)
Stores the username/password combination in the wallet without user interaction.boolean
writeUsernamePassword(String walletKey, String username, byte[] password, boolean askForMasterpassword)
Stores the username/password combination in the wallet without user interaction.
-
Method Details
-
question
Asks a yes/no question. The method returns when the user clicks yes or no.- Parameters:
title
-question
-- Returns:
- true if yes
-
message
Shows the given message as information dialog. The method returns when the user clicks OK.- Parameters:
title
-message
-
-
warning
Shows the given message as warning dialog. The method returns when the user clicks OK.- Parameters:
title
-message
-
-
critical
Shows the given message as error dialog. The method returns when the user clicks OK.- Parameters:
title
-message
-
-
input
Asks the user to enter N lines whereas N is the number of submitted description texts. The method returns when the user clicks OK or CANCEL.- Parameters:
title
-message
-descriptions
-echos
- this array may be null or contain the echo mode of the user entered text. true: the entered text is visible. false: the entered text is shown as password (dots).- Returns:
- an array of strings if OK was clicked, null otherwise.
-
getPassword
The same as getPassword(url, message, false).- Parameters:
url
- the target URL the login is needed for.
If null the wallet cannot be used to store and recover the login.message
- the login purpose- Returns:
- password
-
getPassword
Prompts for a password. The message describes the purpose. If the login is stored in the Omix security wallet, no dialog appears but the method immediately returns the stored login. This can be overridden by forceOverride.- Parameters:
url
- the target URL the login is needed for.
If null the wallet cannot be used to store and recover the login.message
- the login purposeforceOverride
- if true the login is asked even if available in the wallet.- Returns:
- password
-
getPassword
The same as getPassword(walletKey, message, false).- Parameters:
walletKey
- the key the login is associated with in the wallet.
If null the wallet cannot be used to store and recover the login.message
- the login purpose- Returns:
- password
-
getPassword
Prompts for a password. The message describes the purpose. If the login is stored in the Omix security wallet, no dialog appears but the method immediately returns the stored login. This can be overridden by forceOverride.- Parameters:
walletKey
- the key the login is associated with in the wallet.
If null the wallet cannot be used to store and recover the login.message
- the login purposeforceOverride
- if true the login is asked even if available in the wallet.- Returns:
- password
-
getPassphrase
The same as getPassphrase(url, message, false).- Parameters:
url
- the target URL the login is needed for.
If null the wallet cannot be used to store and recover the login.message
- the login purpose- Returns:
- passphrase
-
getPassphrase
The message describes the purpose. If the login is stored in the Omix security wallet, no dialog appears but the method immediately returns the stored login. This can be overridden by forceOverride.- Parameters:
walletKey
- the key the login is associated with in the wallet.
If null the wallet cannot be used to store and recover the login.message
- the login purposeforceOverride
- if true the login is asked even if available in the wallet.- Returns:
- passphrase
-
getPassphrase
The same as getPassphrase(walletKey, message, false).- Parameters:
walletKey
- the key the login is associated with in the wallet.
If null the wallet cannot be used to store and recover the login.message
- the login purpose- Returns:
- passphrase
-
getPassphrase
The message describes the purpose. If the login is stored in the Omix security wallet, no dialog appears but the method immediately returns the stored login. This can be overridden by forceOverride.- Parameters:
url
- the target URL the login is needed for.
If null the wallet cannot be used to store and recover the login.message
- the login purposeforceOverride
- if true the login is asked even if available in the wallet.- Returns:
- passphrase
-
getUsernamePassword
The same as getUsernamePassword(url, message, false).- Parameters:
url
- the target URL the login is needed for.
If null the wallet cannot be used to store and recover the login.message
- the login purpose- Returns:
- username & password
-
getUsernamePassword
Prompts for username & password. The message describes the purpose. If the login is stored in the Omix security wallet, no dialog appears but the method immediately returns the stored login. This can be overridden by forceOverride.- Parameters:
url
- the target URL the login is needed for.
If null the wallet cannot be used to store and recover the login.message
- the login purposeforceOverride
- if true the login is asked even if available in the wallet.- Returns:
- username & password
-
getUsernamePassword
The same as getUsernamePassword(url, message, username, false).- Parameters:
url
- the target URL the login is needed for.
If null the wallet cannot be used to store and recover the login.message
- the login purposeusername
- an initial suggested username- Returns:
- username & password
-
getUsernamePassword
Authenticator.UsernamePassword getUsernamePassword(URL url, String message, String username, boolean forceOverride)Prompts for username & password. The message describes the purpose. If the login is stored in the Omix security wallet, no dialog appears but the method immediately returns the stored login. This can be overridden by forceOverride.- Parameters:
url
- the target URL the login is needed for.
If null the wallet cannot be used to store and recover the login.message
- the login purposeusername
- an initial suggested usernameforceOverride
- if true the login is asked even if available in the wallet.- Returns:
- username & password
-
getUsernamePassword
Authenticator.UsernamePassword getUsernamePassword(String walletKey, String message, boolean forceOverride)Prompts for username & password. The message describes the purpose. If the login is stored in the Omix security wallet, no dialog appears but the method immediately returns the stored login. This can be overridden by forceOverride.- Parameters:
walletKey
- the key the login is associated with in the wallet.
If null the wallet cannot be used to store and recover the login.message
- the login purposeforceOverride
- if true the login is asked even if available in the wallet.- Returns:
- username & password
-
getUsernamePassword
Authenticator.UsernamePassword getUsernamePassword(String walletKey, String message, String username)The same as getUsernamePassword(walletKey, message, username, false).- Parameters:
walletKey
- the key the login is associated with in the wallet.
If null the wallet cannot be used to store and recover the login.message
- the login purposeusername
- an initial suggested username- Returns:
- username & password
-
getUsernamePassword
Authenticator.UsernamePassword getUsernamePassword(String walletKey, String message, String username, boolean forceOverride)Prompts for username & password. The message describes the purpose. If the login is stored in the Omix security wallet, no dialog appears but the method immediately returns the stored login. This can be overridden by forceOverride.- Parameters:
walletKey
- the key the login is associated with in the wallet.
If null the wallet cannot be used to store and recover the login.message
- the login purposeusername
- an initial suggested usernameforceOverride
- if true the login is asked even if available in the wallet.- Returns:
- username & password
-
getDomainUsernamePassword
The same as getDomainUsernamePassword(url, message, false).- Parameters:
url
- the target URL the login is needed for.
If null the wallet cannot be used to store and recover the login.message
- the login purpose- Returns:
- domain/username & password
-
getDomainUsernamePassword
Authenticator.DomainUsernamePassword getDomainUsernamePassword(URL url, String message, boolean forceOverride)Prompts for domain/username & password. The message describes the purpose. If the login is stored in the Omix security wallet, no dialog appears but the method immediately returns the stored login. This can be overridden by forceOverride.- Parameters:
url
- the target URL the login is needed for.
If null the wallet cannot be used to store and recover the login.message
- the login purposeforceOverride
- if true the login is asked even if available in the wallet.- Returns:
- domain/username & password
-
getDomainUsernamePassword
Authenticator.DomainUsernamePassword getDomainUsernamePassword(URL url, String message, String domain, String username)The same as getDomainUsernamePassword(url, message, domain, username, false).- Parameters:
url
- the target URL the login is needed for.
If null the wallet cannot be used to store and recover the login.message
- the login purposedomain
- an initial suggested domainusername
- an initial suggested username- Returns:
- domain/username & password
-
getDomainUsernamePassword
Authenticator.DomainUsernamePassword getDomainUsernamePassword(URL url, String message, String domain, String username, boolean forceOverride)Prompts for domain/username & password. The message describes the purpose. If the login is stored in the Omix security wallet, no dialog appears but the method immediately returns the stored login. This can be overridden by forceOverride.- Parameters:
url
- the target URL the login is needed for.
If null the wallet cannot be used to store and recover the login.message
- the login purposedomain
- an initial suggested domainusername
- an initial suggested usernameforceOverride
- if true the login is asked even if available in the wallet.- Returns:
- domain/username & password
-
getDomainUsernamePassword
The same as getDomainUsernamePassword(walletKey, message, false).- Parameters:
walletKey
- the key the login is associated with in the wallet.
If null the wallet cannot be used to store and recover the login.message
- the login purpose- Returns:
- domain/username & password
-
getDomainUsernamePassword
Authenticator.DomainUsernamePassword getDomainUsernamePassword(String walletKey, String message, boolean forceOverride)Prompts for domain/username & password. The message describes the purpose. If the login is stored in the Omix security wallet, no dialog appears but the method immediately returns the stored login. This can be overridden by forceOverride.- Parameters:
walletKey
- the key the login is associated with in the wallet.
If null the wallet cannot be used to store and recover the login.message
- the login purposeforceOverride
- if true the login is asked even if available in the wallet.- Returns:
- domain/username & password
-
getDomainUsernamePassword
Authenticator.DomainUsernamePassword getDomainUsernamePassword(String walletKey, String message, String domain, String username)The same as getDomainUsernamePassword(walletKey, message, domain, username, false).- Parameters:
walletKey
- the key the login is associated with in the wallet.
If null the wallet cannot be used to store and recover the login.message
- the login purposedomain
- an initial suggested domainusername
- an initial suggested username- Returns:
- domain/username & password
-
getDomainUsernamePassword
Authenticator.DomainUsernamePassword getDomainUsernamePassword(String walletKey, String message, String domain, String username, boolean forceOverride)Prompts for domain/username & password. The message describes the purpose. If the login is stored in the Omix security wallet, no dialog appears but the method immediately returns the stored login. This can be overridden by forceOverride.- Parameters:
walletKey
- the key the login is associated with in the wallet.
If null the wallet cannot be used to store and recover the login.message
- the login purposedomain
- an initial suggested domainusername
- an initial suggested usernameforceOverride
- if true the login is asked even if available in the wallet.- Returns:
- domain/username & password
-
readUsernamePassword
Reads username & password from the wallet without user interaction.- Parameters:
walletKey
- the key the login is associated with in the wallet.- Returns:
- username & password if available, null otherwise.
- Since:
- Omix 1.9.0
-
readUsernamePassword
Authenticator.UsernamePassword readUsernamePassword(String walletKey, boolean askForMasterpassword)Reads username & password from the wallet without user request. However, when askForMasterpassword=true and the wallet is protected with a master password, a dialog appears asking the user to enter the master password.- Parameters:
walletKey
- the key the login is associated with in the wallet.askForMasterpassword
-- Returns:
- username & password if available, null otherwise.
- Since:
- Omix 1.9.0
-
writeUsernamePassword
Stores the username/password combination in the wallet without user interaction. If the wallet is protected by a master password and has not yet been unlocked, storing fails.- Parameters:
walletKey
- the key the login is associated with in the wallet.username
- to be stored in the walletpassword
- to be stored in the wallet- Returns:
- if successfully stored in the wallet (unless the wallet is not protected).
- Since:
- Omix 1.9.0
-
writeUsernamePassword
boolean writeUsernamePassword(String walletKey, String username, byte[] password, boolean askForMasterpassword)Stores the username/password combination in the wallet without user interaction. However, when askForMasterpassword=true and the wallet is protected with a master password, a dialog appears asking the user to enter the master password.- Parameters:
walletKey
- the key the login is associated with in the wallet.username
- to be stored in the walletpassword
- to be stored in the walletaskForMasterpassword
-- Returns:
- if successfully stored in the wallet (unless the wallet is not protected).
- Since:
- Omix 1.9.0
-