return AliveState.ONLINE;
}
@Override
public Authentication authenticate(String username, Credentials credentials) throws AuthenticationException {
JiraRestClientFactory restClientFactory = new AsynchronousJiraRestClientFactory();
String givenPassword = ((Password) credentials).getValue();
JiraRestClient restClient =
restClientFactory.createWithBasicHttpAuthentication(ServerConfig.serverUri, username, givenPassword);
try {
restClient.getSessionClient().getCurrentSession().claim();
} catch (Exception e) {
// statuscode 401: missing user or wrong pass. 403: forbidden (e.g.captcha required)
throw new AuthenticationException(e);