Top Description Fields Constructors Methods
org.eclipse.jgit.internal.transport.sshd.auth

public abstract Class BasicAuthentication<ParameterType, TokenType>

extends AbstractAuthenticationHandler<ParameterType, TokenType>
Class Inheritance
Known Direct Subclasses
org.eclipse.jgit.internal.transport.sshd.proxy.HttpClientConnector.HttpBasicAuthentication, org.eclipse.jgit.internal.transport.sshd.proxy.Socks5ClientConnector.SocksBasicAuthentication
Type Parameters
<ParameterType>
defining the parameter type for the authentication
<TokenType>
defining the token type for the authentication
Static Imports
java.nio.charset.StandardCharsets.UTF_8

An abstract implementation of a username-password authentication. It can be given an initial known username-password pair; if so, this will be tried first. Subsequent rounds will then try to obtain a user name and password via the global Authenticator.

Field Summary

Modifier and TypeField and Description
protected byte[]
password

The current password.

protected String
user

The current user name.

Inherited from org.eclipse.jgit.internal.transport.sshd.auth.AbstractAuthenticationHandler:
doneparamsproxy

Constructor Summary

AccessConstructor and Description
public
BasicAuthentication(InetSocketAddress
InetSocketAddress of the proxy to connect to
proxy
,
String
initial user name to try; may be null
initialUser
,
char[]
initial password to try, may be null
initialPassword
)

Creates a new BasicAuthentication to authenticate with the given proxy.

Method Summary

Modifier and TypeMethod and Description
protected void
askCredentials()

Asks for credentials via the global Authenticator.

protected void
clearPassword()

Clears the password.

public final void
close()

Implements org.eclipse.jgit.internal.transport.sshd.auth.AuthenticationHandler.close.

Closes this stream and releases any system resources associated with it.

private byte[]
convert(char[] pass)

public void
process()

Implements org.eclipse.jgit.internal.transport.sshd.auth.AuthenticationHandler.process.

Produces the next authentication token, if any.

public final void
start()

Implements org.eclipse.jgit.internal.transport.sshd.auth.AuthenticationHandler.start.

Produces the initial authentication token that can be then retrieved via getToken().

Inherited from org.eclipse.jgit.internal.transport.sshd.auth.AbstractAuthenticationHandler:
isDonesetParams

Field Detail

passwordback to summary
protected byte[] password

The current password.

userback to summary
protected String user

The current user name.

Constructor Detail

BasicAuthenticationback to summary
public BasicAuthentication(InetSocketAddress proxy, String initialUser, char[] initialPassword)

Creates a new BasicAuthentication to authenticate with the given proxy.

Parameters
proxy:InetSocketAddress

InetSocketAddress of the proxy to connect to

initialUser:String

initial user name to try; may be null

initialPassword:char[]

initial password to try, may be null

Method Detail

askCredentialsback to summary
protected void askCredentials()

Asks for credentials via the global Authenticator.

clearPasswordback to summary
protected void clearPassword()

Clears the password.

closeback to summary
public final void close()

Implements org.eclipse.jgit.internal.transport.sshd.auth.AuthenticationHandler.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
convertback to summary
private byte[] convert(char[] pass)
Annotations
@SuppressWarnings:ByteBufferBackingArray
processback to summary
public void process() throws Exception

Implements org.eclipse.jgit.internal.transport.sshd.auth.AuthenticationHandler.process.

Doc from org.eclipse.jgit.internal.transport.sshd.auth.AuthenticationHandler.process.

Produces the next authentication token, if any.

Annotations
@Override
Exceptions
Exception:
if an error occurs
startback to summary
public final void start() throws Exception

Implements org.eclipse.jgit.internal.transport.sshd.auth.AuthenticationHandler.start.

Doc from org.eclipse.jgit.internal.transport.sshd.auth.AuthenticationHandler.start.

Produces the initial authentication token that can be then retrieved via getToken().

Annotations
@Override
Exceptions
Exception:
if an error occurs