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

Examples of io.fathom.cloud.openstack.client.identity.model.V2AuthResponse$User


      // Get the UserService.
      UserServiceInterface userService = user.getService(DfpService.V201308.USER_SERVICE);

      // Get the current user.
      User usr = userService.getCurrentUser();

      System.out.println("User with ID \"" + usr.getId()
          + "\", email \"" + usr.getEmail()
          + "\", and role \"" + usr.getRoleName() + "\" is the current user.");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here


      // Create an array to store local user objects.
      User[] users = new User[emailAndNames.size()];

      for (int i = 0; i < users.length; i++) {
        // Create the new user structure.
        User newUser = new User();
        newUser.setEmail(emailAndNames.get(i)[0]);
        newUser.setName(emailAndNames.get(i)[1]);
        newUser.setRoleId(roleId);
        newUser.setPreferredLocale("en_US");

        users[i] = newUser;
      }

      // Create the users.
      users = userService.createUsers(users);

      if (users != null) {
        for (User newUser : users) {
          System.out.println("A user with ID \"" + newUser.getId()
              + "\", email \"" + newUser.getEmail()
              + "\", and role \"" + newUser.getRoleName() + "\" was created.");
        }
      } else {
        System.out.println("No users created.");
      }
    } catch (Exception e) {
View Full Code Here

      // Set the ID of the user to get.
      Long userId = Long.parseLong("INSERT_USER_ID_HERE");

      // Get the user.
      User usr = userService.getUser(userId);

      if (usr != null) {
        System.out.println("User with ID \"" + usr.getId()
            + "\" email \"" + usr.getEmail()
            + "\", and role \"" + usr.getRoleName() + "\" was found.");
      } else {
        System.out.println("No user found for this ID.");
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

      // Get the UserService.
      UserServiceInterface userService = user.getService(DfpService.V201311.USER_SERVICE);

      // Get the current user.
      User usr = userService.getCurrentUser();

      System.out.println("User with ID \"" + usr.getId()
          + "\", email \"" + usr.getEmail()
          + "\", and role \"" + usr.getRoleName() + "\" is the current user.");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

        if (this.response == null) {
            V2AuthRequest request = new V2AuthRequest();
            request.auth = new V2AuthRequest.V2AuthCredentials();
            request.auth.tenantName = project;

            V2AuthResponse responseChallenge = identityClient.doLogin(request, certificateAndKey);

            String challenge = responseChallenge.challenge;
            V2AuthRequest.ChallengeResponse challengeResponse = ChallengeResponses.respondToAuthChallenge(
                    certificateAndKey, challenge);

            request.auth.challengeResponse = challengeResponse;

            V2AuthResponse response = identityClient.doLogin(request, certificateAndKey);

            this.response = response;
        }
        return this.response;
    }
View Full Code Here

        return this.response;
    }

    @Override
    public String findEndpoint(String type) throws RestClientException {
        V2AuthResponse response = getResponse();
        if (response.access != null && response.access.serviceCatalog != null) {
            for (V2AuthResponse.Service service : response.access.serviceCatalog) {
                if (!service.type.equals(type)) {
                    continue;
                }
View Full Code Here

        return new CertificateAuthTokenProvider(identityClient, project, certificateAndKey);
    }

    @Override
    public String getToken() throws RestClientException {
        V2AuthResponse response = getResponse();

        if (response == null || response.access == null || response.access.token == null) {
            log.warn("Unable to get auth token");
            return null;
        }
View Full Code Here

        return this.response;
    }

    @Override
    public String findEndpoint(String type) throws RestClientException {
        V2AuthResponse response = getResponse();
        if (response.access != null && response.access.serviceCatalog != null) {
            for (V2AuthResponse.Service service : response.access.serviceCatalog) {
                if (!service.type.equals(type)) {
                    continue;
                }
View Full Code Here

    // return build(identityClient, tenant, username, password);
    // }

    @Override
    public String getToken() throws RestClientException {
        V2AuthResponse response = getResponse();

        return response.access.token.id;
    }
View Full Code Here

            Form<User> userForm = Form.form(User.class).bind(ImmutableMap.of("email", "e"));
            //#handle-errors
            if (userForm.hasErrors()) {
                return badRequest(views.html.form.render(userForm));
            } else {
                User user = userForm.get();
                return ok("Got user " + user);
            }
            //#handle-errors
        }
View Full Code Here

TOP

Related Classes of io.fathom.cloud.openstack.client.identity.model.V2AuthResponse$User

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.