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

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


  }

  public Access getAccessByTenant(String tenantName) {
    Access access = hashTenantAccess.get(tenantName);
    if (access == null) {
      access = keystone.tokens().authenticate(new UsernamePassword(username, password))
        .withTenantName(tenantName)
        .execute();
      hashTenantAccess.put(tenantName, access);
    }
    return access;
View Full Code Here


    }
   
    public class Builder {
     
      public Authenticate withUsernamePassword(String username, String password) {
        Authentication authentication = new UsernamePassword(username, password);
        return new Authenticate(authentication);
      }
View Full Code Here

   * @param args
   */
  public static void main(String[] args) {
    Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL);
    Access access = keystone.tokens()
        .authenticate(new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD))
        .withTenantName("admin")
        .execute();
   
    Ceilometer ceilometer = new Ceilometer(ExamplesConfiguration.CEILOMETER_ENDPOINT);
    ceilometer.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId()));
View Full Code Here

import com.woorea.openstack.nova.model.Servers;

public class NovaStopStartServer {
  public static void main(String[] args) throws InterruptedException {
    Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL);
    Access access = keystone.tokens().authenticate(new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD))
        .withTenantName(ExamplesConfiguration.TENANT_NAME)
        .execute();

    //use the token in the following requests
    keystone.token(access.getToken().getId());
View Full Code Here

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

   */
  public static void main(String[] args) {
    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))
      .withTenantName("admin")
      .execute();

    User user = new User();
    user.setEmail("luis@woorea.es");
View Full Code Here

   * @param args
   */
  public static void main(String[] args) {
   
    Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL);
    Access access = keystone.tokens().authenticate(new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)).execute();
   
    //use the token in the following requests
    keystone.token(access.getToken().getId());
   
    Tenants tenants = keystone.tenants().list().execute();
View Full Code Here

   */
  public static void main(String[] args) {
    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();
View Full Code Here

   */
  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()));
   
View Full Code Here

   */
  public static void main(String[] args) {
    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();

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

    Tenant tenant = new Tenant();
View Full Code Here

TOP

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

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.