/** * Invalidates the JWT currently in use. */ public void logout() { getService(AccessTokenService.class).logout(); cleanup(); }
/** * Attempts to extend the lifespan of the JWT currently in use. */ public void refresh() { String jwt = getService(AccessTokenService.class).refresh().getHeaderString(RESTHeaders.TOKEN); restClientFactory.getHeaders().put(HttpHeaders.AUTHORIZATION, Collections.singletonList("Bearer " + jwt)); }
public void delete(final String key) { getService(AccessTokenService.class).delete(key); }
restClientFactory.setPassword(((BasicAuthenticationHandler) handler).getPassword()); String jwt = getService(AccessTokenService.class).login().getHeaderString(RESTHeaders.TOKEN); restClientFactory.getHeaders().put(HttpHeaders.AUTHORIZATION, Collections.singletonList("Bearer " + jwt));
public int count() { return getService(AccessTokenService.class).list( new AccessTokenQuery.Builder().page(1).size(1).build()). getTotalCount(); }
restClientFactory.setPassword(((BasicAuthenticationHandler) handler).getPassword()); String jwt = getService(AccessTokenService.class).login().getHeaderString(RESTHeaders.TOKEN); restClientFactory.getHeaders().put(HttpHeaders.AUTHORIZATION, Collections.singletonList("Bearer " + jwt));
public List<AccessTokenTO> list(final int page, final int size, final SortParam<String> sort) { return getService(AccessTokenService.class).list( new AccessTokenQuery.Builder().page(page).size(size).orderBy(toOrderBy(sort)).build()). getResult(); }
/** * Invalidates the JWT currently in use. */ public void logout() { getService(AccessTokenService.class).logout(); cleanup(); }
/** * Attempts to extend the lifespan of the JWT currently in use. */ public void refresh() { String jwt = getService(AccessTokenService.class).refresh().getHeaderString(RESTHeaders.TOKEN); restClientFactory.getHeaders().put(HttpHeaders.AUTHORIZATION, Collections.singletonList("Bearer " + jwt)); }