Module omix.api

Interface Authenticator


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.

Authenticator

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
  • Method Details

    • question

      boolean question​(String title, String question)
      Asks a yes/no question. The method returns when the user clicks yes or no.
      Parameters:
      title -
      question -
      Returns:
      true if yes
    • message

      void message​(String title, String message)
      Shows the given message as information dialog. The method returns when the user clicks OK.
      Parameters:
      title -
      message -
    • warning

      void warning​(String title, String message)
      Shows the given message as warning dialog. The method returns when the user clicks OK.
      Parameters:
      title -
      message -
    • critical

      void critical​(String title, String message)
      Shows the given message as error dialog. The method returns when the user clicks OK.
      Parameters:
      title -
      message -
    • input

      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. 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

      Authenticator.Password getPassword​(URL url, String message)
      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

      Authenticator.Password getPassword​(URL url, String message, boolean forceOverride)
      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 purpose
      forceOverride - if true the login is asked even if available in the wallet.
      Returns:
      password
    • getPassword

      Authenticator.Password getPassword​(String walletKey, String message)
      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

      Authenticator.Password getPassword​(String walletKey, String message, boolean forceOverride)
      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 purpose
      forceOverride - if true the login is asked even if available in the wallet.
      Returns:
      password
    • getPassphrase

      Authenticator.Password getPassphrase​(URL url, String message)
      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

      Authenticator.Password getPassphrase​(String walletKey, String message, boolean forceOverride)
      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 purpose
      forceOverride - if true the login is asked even if available in the wallet.
      Returns:
      passphrase
    • getPassphrase

      Authenticator.Password getPassphrase​(String walletKey, String message)
      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

      Authenticator.Password getPassphrase​(URL url, String message, boolean forceOverride)
      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 purpose
      forceOverride - if true the login is asked even if available in the wallet.
      Returns:
      passphrase
    • getUsernamePassword

      Authenticator.UsernamePassword getUsernamePassword​(URL url, String message)
      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

      Authenticator.UsernamePassword getUsernamePassword​(URL url, 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:
      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
      forceOverride - if true the login is asked even if available in the wallet.
      Returns:
      username & password
    • getUsernamePassword

      Authenticator.UsernamePassword getUsernamePassword​(URL url, String message, String username)
      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 purpose
      username - 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 purpose
      username - an initial suggested username
      forceOverride - 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 purpose
      forceOverride - 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 purpose
      username - 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 purpose
      username - an initial suggested username
      forceOverride - if true the login is asked even if available in the wallet.
      Returns:
      username & password
    • getDomainUsernamePassword

      Authenticator.DomainUsernamePassword getDomainUsernamePassword​(URL url, String message)
      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 purpose
      forceOverride - 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 purpose
      domain - an initial suggested domain
      username - 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 purpose
      domain - an initial suggested domain
      username - an initial suggested username
      forceOverride - if true the login is asked even if available in the wallet.
      Returns:
      domain/username & password
    • getDomainUsernamePassword

      Authenticator.DomainUsernamePassword getDomainUsernamePassword​(String walletKey, String message)
      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 purpose
      forceOverride - 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 purpose
      domain - an initial suggested domain
      username - 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 purpose
      domain - an initial suggested domain
      username - an initial suggested username
      forceOverride - if true the login is asked even if available in the wallet.
      Returns:
      domain/username & password
    • readUsernamePassword

      Authenticator.UsernamePassword readUsernamePassword​(String walletKey)
      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

      boolean writeUsernamePassword​(String walletKey, String username, byte[] password)
      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 wallet
      password - 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 wallet
      password - to be stored in the wallet
      askForMasterpassword -
      Returns:
      if successfully stored in the wallet (unless the wallet is not protected).
      Since:
      Omix 1.9.0