@MinDoc(copyright="Copyright 2001 - 2004, 2009 A. Weinert", author="Albrecht Weinert", version="V.44", lastModified="6.05.2021", usage="import", purpose="stateful class; objects to hold authentication info") public class Authentication extends Authenticator
Authentication
object
is also effective for an Input
if this uses an URL
connection.new Authentication("name", "passw", true); Input ein = new Input("urlDenotation"); ein.copyTo( // or what ever one likes to do with the data
Authentication
object store the password
in clear
text in an immutable String. The latter will avoided as far as possible.
Authentication
objects are to be used for network connections
mainly to Linux servers requiring clear text passwords. Do not use for
JMX or safety critical applications.Input
Authenticator.RequestorType
Modifier and Type | Field and Description |
---|---|
protected String |
name
The user name.
|
protected char[] |
pass
The password.
|
protected PasswordAuthentication |
pAuth
Authentication with Password.
|
Constructor and Description |
---|
Authentication(String name,
char[] pass,
boolean setD)
Construct with name, password and optional registration.
|
Authentication(String name,
String pass,
boolean setD)
Construct with name, password and optional registration.
|
Modifier and Type | Method and Description |
---|---|
void |
clearPass()
Clear the password.
|
protected PasswordAuthentication |
getPasswordAuthentication()
Authentication with Password.
|
void |
setAsDefault()
Set as default authenticator.
|
getRequestingHost, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingScheme, getRequestingSite, getRequestingURL, getRequestorType, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, setDefault
protected String name
protected char[] pass
Authentication(String, char[], boolean)
is to be preferred over
Authentication(String, String, boolean)
.name
,
clearPass()
protected volatile PasswordAuthentication pAuth
public Authentication(String name, char[] pass, boolean setD)
Authentication
object is made and registered as default
authenticator.name
- the namepass
- the passwordsetD
- true: Set as default authenticatorpublic Authentication(String name, String pass, boolean setD)
Authentication
object will be made and set as default
authenticator.name
- the namepass
- the passwordsetD
- true: Set as default authenticatorAuthentication(String, char[], boolean)
,
pass
public void clearPass()
protected PasswordAuthentication getPasswordAuthentication()
PasswordAuthentication
object
for this Authentication
object.getPasswordAuthentication
in class Authenticator
public void setAsDefault()
java.net
package will use this
object's setting if a connection require authentication.