Package io.fathom.cloud.openstack.client.identity

Examples of io.fathom.cloud.openstack.client.identity.TokenProvider


        runSshCommand("id-project-create", "-u", username, "-p", password, "-proj", project);
        runSshCommand("id-role-grant", "-u", username, "-p", password, "-touser", username, "-proj", project, "-r",
                "admin");

        {
            TokenProvider tokenProvider = AuthTokenProvider.build(identityClient, project, username, password);
            OpenstackClient client = OpenstackClient.build(tokenProvider);

            V2ProjectList projects = client.getIdentity().listProjects();

            assertEquals(1, projects.tenants.size());
            assertEquals(project, projects.tenants.get(0).name);
            assertEquals(true, projects.tenants.get(0).enabled);
        }

        String password2 = "moresecrets";
        runSshCommand("id-password-change", "-u", username, "-p", password2, "-o", workdir.resolve("passwordrecovery")
                .toString());

        {
            TokenProvider tokenProvider = AuthTokenProvider.build(identityClient, project, username, password2);
            OpenstackClient client = OpenstackClient.build(tokenProvider);

            V2ProjectList projects = client.getIdentity().listProjects();

            assertEquals(1, projects.tenants.size());
View Full Code Here

TOP

Related Classes of io.fathom.cloud.openstack.client.identity.TokenProvider

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.