/**
* @param args
*/
public static void main(String[] args) throws Exception {
Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL);
//access with unscoped token
Access access = keystone.tokens().authenticate(
new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD))
.execute();
//use the token in the following requests
keystone.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId()));
Tenants tenants = keystone.tenants().list().execute();
//try to exchange token using the first tenant
if(tenants.getList().size() > 0) {
access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())).withTenantId(tenants.getList().get(0).getId()).execute();
Swift swift = new Swift(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "object-store", null, "public"));
swift.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId()));
//swiftClient.execute(new DeleteContainer("navidad2"));