/** * it is important that we close any sessions on close to help the server not become overloaded. */ @PreDestroy public void logoutOnClose() { for (LoginResponse s : authenticationResponseCache.asMap().values()) { try { sessionClient.logoutUser(s.getSessionKey()); } catch (Exception e) { logger.error(e, "error logging out session %s", s.getSessionKey()); } } } }
/** * it is important that we close any sessions on close to help the server not become overloaded. */ @PreDestroy public void logoutOnClose() { for (LoginResponse s : authenticationResponseCache.asMap().values()) { try { sessionClient.logoutUser(s.getSessionKey()); } catch (Exception e) { logger.error(e, "error logging out session %s", s.getSessionKey()); } } } }
/** * it is important that we close any sessions on close to help the server not become overloaded. */ @PreDestroy public void logoutOnClose() { for (LoginResponse s : authenticationResponseCache.asMap().values()) { try { sessionClient.logoutUser(s.getSessionKey()); } catch (Exception e) { logger.error(e, "error logging out session %s", s.getSessionKey()); } } } }
@Override public HttpRequest filter(HttpRequest request) throws HttpException { LoginResponse loginResponse = loginResponseSupplier.get(); Builder<?> builder = request.toBuilder(); builder.replaceHeader(HttpHeaders.COOKIE, "JSESSIONID=" + loginResponse.getJSessionId()); builder.replaceQueryParam("sessionkey", loginResponse.getSessionKey()); return builder.build(); }
@Override public HttpRequest filter(HttpRequest request) throws HttpException { LoginResponse loginResponse = loginResponseSupplier.get(); Builder<?> builder = request.toBuilder(); builder.replaceHeader(HttpHeaders.COOKIE, "JSESSIONID=" + loginResponse.getJSessionId()); builder.replaceQueryParam("sessionkey", loginResponse.getSessionKey()); return builder.build(); }
@Override public HttpRequest filter(HttpRequest request) throws HttpException { LoginResponse loginResponse = loginResponseSupplier.get(); Builder<?> builder = request.toBuilder(); builder.replaceHeader(HttpHeaders.COOKIE, "JSESSIONID=" + loginResponse.getJSessionId()); builder.replaceQueryParam("sessionkey", loginResponse.getSessionKey()); return builder.build(); }
private void checkLoginAsTheNewUser(String expectedUsername) { LoginResponse response = globalAdminClient.getSessionClient().loginUserInDomainWithHashOfPassword( expectedUsername, "", base16().lowerCase().encode(md5().hashString("password", UTF_8).asBytes())); assertNotNull(response); assertNotNull(response.getSessionKey()); assertNotNull(response.getJSessionId()); client.getSessionClient().logoutUser(response.getSessionKey()); } }
private void checkLoginAsTheNewUser(String expectedUsername) { LoginResponse response = globalAdminClient.getSessionApi().loginUserInDomainWithHashOfPassword( expectedUsername, "", base16().lowerCase().encode(md5().hashString("password", UTF_8).asBytes())); assertNotNull(response); assertNotNull(response.getSessionKey()); assertNotNull(response.getJSessionId()); client.getSessionApi().logoutUser(response.getSessionKey()); } }
public T fromLoginResponse(LoginResponse in) { return this .username(in.getUsername()) .userId(in.getUserId()) .password(in.getPassword()) .domainId(in.getDomainId()) .timeout(in.getTimeout()) .registered(in.isRegistered()) .accountName(in.getAccountName()) .firstName(in.getFirstName()) .lastName(in.getLastName()) .accountType(in.getAccountType()) .timezone(in.getTimezone()) .timezoneOffset(in.getTimezoneOffset()) .sessionKey(in.getSessionKey()) .jSessionId(in.getJSessionId()); } }
public T fromLoginResponse(LoginResponse in) { return this .username(in.getUsername()) .userId(in.getUserId()) .password(in.getPassword()) .domainId(in.getDomainId()) .timeout(in.getTimeout()) .registered(in.isRegistered()) .accountName(in.getAccountName()) .firstName(in.getFirstName()) .lastName(in.getLastName()) .accountType(in.getAccountType()) .timezone(in.getTimezone()) .timezoneOffset(in.getTimezoneOffset()) .sessionKey(in.getSessionKey()) .jSessionId(in.getJSessionId()); } }
public T fromLoginResponse(LoginResponse in) { return this .username(in.getUsername()) .userId(in.getUserId()) .password(in.getPassword()) .domainId(in.getDomainId()) .timeout(in.getTimeout()) .registered(in.isRegistered()) .accountName(in.getAccountName()) .firstName(in.getFirstName()) .lastName(in.getLastName()) .accountType(in.getAccountType()) .timezone(in.getTimezone()) .timezoneOffset(in.getTimezoneOffset()) .sessionKey(in.getSessionKey()) .jSessionId(in.getJSessionId()); } }