Package com.woorea.openstack.keystone.model.authentication

Examples of com.woorea.openstack.keystone.model.authentication.TokenAuthentication


        Authentication authentication = new UsernamePassword(username, password);
        return new Authenticate(authentication);
      }
     
      public Authenticate withToken(String token) {
        Authentication authentication = new TokenAuthentication(token);
        return new Authenticate(authentication);
      }
View Full Code Here


      // access with tenant
      Network network = new Network();
      access = keystone
          .tokens()
          .authenticate(
              new TokenAuthentication(access.getToken().getId()))
          .withTenantId("tenantId").execute();
      Quantum quantum = new Quantum(KeystoneUtils.findEndpointURL(
          access.getServiceCatalog(), "network", null, "public"));
      quantum.setTokenProvider(new OpenStackSimpleTokenProvider(access
          .getToken().getId()));
View Full Code Here

    Tenants tenants = keystone.tenants().list().execute();
    // try to exchange token using the first tenant
    if (tenants.getList().size() > 0) {
      // access with tenant
      access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())).withTenantId(tenants.getList().get(0).getId()).execute();

      Quantum quantumClient = new Quantum(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "network",  null, "public"));
      quantumClient.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId()));

      Network networkQuery = new Network();
View Full Code Here

    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();
     
      //NovaClient novaClient = new NovaClient(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "compute", null, "public"), access.getToken().getId());
      Nova novaClient = new Nova(ExamplesConfiguration.NOVA_ENDPOINT.concat("/").concat(tenants.getList().get(0).getId()));
View Full Code Here

    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"));
View Full Code Here

    //access with unscoped token
    Access access = keystone.tokens().authenticate(
        new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD))
        .execute();

    access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())).withTenantName("admin").execute();

    Tenant tenant = new Tenant();
    tenant.setName("benn.cs");
    tenant.setDescription("benn.cs");
    tenant.setEnabled(true);
View Full Code Here

    Tenants tenants = keystone.tenants().list().execute();
    // try to exchange token using the first tenant
    if (tenants.getList().size() > 0) {
      // access with tenant
      access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())).withTenantId(tenants.getList().get(0).getId()).execute();

      Quantum quantum = new Quantum(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "network",  null, "public"));
      quantum.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId()));

      Networks networks = quantum.networks().list().execute();
View Full Code Here

    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();
     
      //NovaClient novaClient = new NovaClient(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "compute", null, "public"), access.getToken().getId());
      Nova novaClient = new Nova(ExamplesConfiguration.NOVA_ENDPOINT.concat("/").concat(tenants.getList().get(0).getId()));
      novaClient.token(access.getToken().getId());
      //novaClient.enableLogging(Logger.getLogger("nova"), 100 * 1024);
 
View Full Code Here

TOP

Related Classes of com.woorea.openstack.keystone.model.authentication.TokenAuthentication

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.