Class BasicAuthentication<ParameterType,TokenType>
- java.lang.Object
-
- org.eclipse.jgit.internal.transport.sshd.auth.AbstractAuthenticationHandler<ParameterType,TokenType>
-
- org.eclipse.jgit.internal.transport.sshd.auth.BasicAuthentication<ParameterType,TokenType>
-
- Type Parameters:
ParameterType- defining the parameter type for the authenticationTokenType- defining the token type for the authentication
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,AuthenticationHandler<ParameterType,TokenType>
- Direct Known Subclasses:
HttpClientConnector.HttpBasicAuthentication,Socks5ClientConnector.SocksBasicAuthentication
public abstract class BasicAuthentication<ParameterType,TokenType> extends AbstractAuthenticationHandler<ParameterType,TokenType>
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 globalAuthenticator.
-
-
Constructor Summary
Constructors Constructor Description BasicAuthentication(java.net.InetSocketAddress proxy, java.lang.String initialUser, char[] initialPassword)Creates a newBasicAuthenticationto authenticate with the givenproxy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaskCredentials()Asks for credentials via the globalAuthenticator.protected voidclearPassword()Clears thepassword.voidclose()private byte[]convert(char[] pass)voidprocess()Produces the next authentication token, if any.voidstart()Produces the initial authentication token that can be then retrieved viaAuthenticationHandler.getToken().-
Methods inherited from class org.eclipse.jgit.internal.transport.sshd.auth.AbstractAuthenticationHandler
isDone, setParams
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.jgit.internal.transport.sshd.auth.AuthenticationHandler
getToken
-
-
-
-
Constructor Detail
-
BasicAuthentication
public BasicAuthentication(java.net.InetSocketAddress proxy, java.lang.String initialUser, char[] initialPassword)Creates a newBasicAuthenticationto authenticate with the givenproxy.- Parameters:
proxy-InetSocketAddressof the proxy to connect toinitialUser- initial user name to try; may benullinitialPassword- initial password to try, may benull
-
-
Method Detail
-
convert
private byte[] convert(char[] pass)
-
clearPassword
protected void clearPassword()
Clears thepassword.
-
close
public final void close()
-
start
public final void start() throws java.lang.ExceptionDescription copied from interface:AuthenticationHandlerProduces the initial authentication token that can be then retrieved viaAuthenticationHandler.getToken().- Throws:
java.lang.Exception- if an error occurs
-
process
public void process() throws java.lang.ExceptionDescription copied from interface:AuthenticationHandlerProduces the next authentication token, if any.- Throws:
java.lang.Exception- if an error occurs
-
askCredentials
protected void askCredentials()
Asks for credentials via the globalAuthenticator.
-
-