antology 2.0.7
Task

<setAuthenticator>

Installs an Authenticator whichs determines user name and password through its configuration, or prompts the user interactively for user name and password through a SWING JOptionPane.

An "authenticator" is used by all JRE URLConnections when a host asks for authentication, e.g. HTTP "401:Unauthorized" and "407: Proxy Authentication Required". Also the <ftp2> task uses the authenticator for server authentication and proxy authentication.

The exact strategy of this authenticator is as follows:

Iff cache="..." is set to a value different from NONE, then the entered user name and/or password are remembered and pre-filled in the next time the authentication dialog pops up. The "remembered" data is not persisted and is lost when the JVM terminates.

Iff store="..." is set to a value different from NONE, then the entered user name and/or password are stored in a persistent "authentication store". That store is a properties file in the user's home directory, and the passwords stored therein are encrypted with a secret key, which is generated ad hoc and stored in another file in the user's home directory (the "key store"). The secret key is protected by a password (called the "master password"), so that an attacker can not compromise the passwords in the authentication store, even if he steals the key store file.

When the secret key is created, the user is prompted to choose the master password:

When a different JVM instance requires the secret key, it prompts the user to enter the master password:

See also:
Authenticator.setDefault(Authenticator)
<credentials>
antology 2.0.7

Copyright © 2019. All rights reserved.