public final class UsernamePasswordLogin extends Object implements Login
A login for the simple username/password use case.
Implementation note: the login() method can only be called
ONCE on an instance of UsernamePassordLogin
because the username and password fields are set to null internally in
the first call due to security concerns. Therefore, you need to create another
instance of UsernamePasswordLogin if the same credentials are to be
retried. Further calls to the login() method will result in an
IllegalStateException being thrown.
Login| Constructor and Description |
|---|
UsernamePasswordLogin(URL youtrackUrl,
String username,
char[] password)
Assumes the
default http client as the
http client to use. |
| Modifier and Type | Method and Description |
|---|---|
Session |
login()
Performs the login function and returns a
Session with sufficient
state to allow further transactions with YouTrack. |
public UsernamePasswordLogin(URL youtrackUrl, String username, char[] password)
default http client as the
http client to use.youtrackUrl - the URL of the YouTrack API endpointusername - the principalpassword - the credentialsUsernamePasswordLogin(URL, String, char[], HttpClient)public Session login() throws AuthenticationException, IOException
LoginSession with sufficient
state to allow further transactions with YouTrack.login in interface LoginAuthenticationException - if the login process fails due to invalid
credentialsIOException - if the YouTrack endpoint is unreachableCopyright © 2017 George Aristy. All rights reserved.