CachingAuthenticator<BasicCredentials, User> authenticator = CachingAuthenticator.wrap(new ElasticSearchAuthenticator(userDao),
CacheBuilderSpec.parse("maximumSize=5,expireAfterAccess=5m"));
environment.addProvider(new BasicAuthProvider<User>(authenticator, "Admin stuff"));
// Create resources
environment.addResource(new RootResource(articleDao));
environment.addResource(new SlugResource(articleDao));
environment.addResource(new SearchResource(articleDao));
environment.addResource(new ArticleResource(articleDao));
environment.addResource(new AdminResource(articleDao));
environment.addResource(new TagResource(articleDao));