Package org.platformlayer.auth.v1

Examples of org.platformlayer.auth.v1.User


  // This can actually be moved to the user-auth system
  public List<X509Certificate> signCsr(String projectKey, CryptoKey projectSecret, String csr) {
    String url = "pki/csr";

    SignCertificateRequest request = new SignCertificateRequest();
    request.setProject(projectKey);
    request.setCsr(csr);
    request.setProjectSecret(FathomdbCrypto.serialize(projectSecret));

    try {
      SignCertificateResponse response = doSimpleXmlRequest(HttpMethod.POST, url, request,
          SignCertificateResponse.class);
View Full Code Here


    request.setProject(projectKey);
    request.setCsr(csr);
    request.setProjectSecret(FathomdbCrypto.serialize(projectSecret));

    try {
      SignCertificateResponse response = doSimpleXmlRequest(HttpMethod.POST, url, request,
          SignCertificateResponse.class);

      List<X509Certificate> certificates = Lists.newArrayList();
      for (String cert : response.getCertificates()) {
        certificates.addAll(CertificateUtils.fromPem(cert));
      }

      return certificates;
    } catch (RestClientException e) {
View Full Code Here

      // ProjectValidation project = access.getProject();
      // if (project == null || !Objects.equal(projectId, project.getId())) {
      // return null;
      // }

      UserValidation userInfo = access.getUser();
      if (userInfo == null) {
        return null;
      }

      ProjectValidation projectInfo = access.getProject();
      if (projectInfo == null) {
        return null;
      }

      // List<String> roles = Lists.newArrayList();
      // UserValidation userInfo = access.getUser();
      // for (Role role : userInfo.getRoles()) {
      // if (!role.getTenantId().equals(projectId)) {
      // throw new IllegalStateException("Tenant mismatch: " + role.getTenantId() + " vs " + projectId);
      // }
      // roles.add(role.getName());
      // }

      // byte[] userSecret = userInfo.getSecret();
      String userKey = userInfo.getName();

      PlatformlayerUserAuthentication user = new PlatformlayerUserAuthentication(authToken, userKey);
      PlatformlayerProjectAuthorization project = buildPlatformlayerProjectAuthorization(user, projectInfo);
      return project;
    } catch (RestClientException e) {
View Full Code Here

      ValidateAccess access = response.getAccess();
      if (access == null) {
        return null;
      }

      UserValidation userInfo = access.getUser();
      if (userInfo == null) {
        return null;
      }

      ProjectValidation projectInfo = access.getProject();
      if (projectInfo == null) {
        return null;
      }

      String userKey = userInfo.getName();

      PlatformlayerUserAuthentication user = new PlatformlayerUserAuthentication(null, userKey);
      PlatformlayerProjectAuthorization project = buildPlatformlayerProjectAuthorization(user, projectInfo);
      return project;
    } catch (RestClientException e) {
View Full Code Here

    url += "?project=" + UrlUtils.urlEncode(projectId);

    try {
      ValidateTokenResponse response = doSimpleXmlRequest(HttpMethod.GET, url, null, ValidateTokenResponse.class);

      ValidateAccess access = response.getAccess();
      if (access == null) {
        return null;
      }

      // ProjectValidation project = access.getProject();
      // if (project == null || !Objects.equal(projectId, project.getId())) {
      // return null;
      // }

      UserValidation userInfo = access.getUser();
      if (userInfo == null) {
        return null;
      }

      ProjectValidation projectInfo = access.getProject();
      if (projectInfo == null) {
        return null;
      }

      // List<String> roles = Lists.newArrayList();
View Full Code Here

    try {
      ValidateTokenResponse response = doSimpleXmlRequest(HttpMethod.POST, url, chainInfo,
          ValidateTokenResponse.class);

      ValidateAccess access = response.getAccess();
      if (access == null) {
        return null;
      }

      UserValidation userInfo = access.getUser();
      if (userInfo == null) {
        return null;
      }

      ProjectValidation projectInfo = access.getProject();
      if (projectInfo == null) {
        return null;
      }

      String userKey = userInfo.getName();
View Full Code Here

    String url = "v2.0/tokens/" + tokenId;

    url += "?project=" + UrlUtils.urlEncode(projectId);

    try {
      ValidateTokenResponse response = doSimpleXmlRequest(HttpMethod.GET, url, null, ValidateTokenResponse.class);

      ValidateAccess access = response.getAccess();
      if (access == null) {
        return null;
      }

      // ProjectValidation project = access.getProject();
View Full Code Here

    url += "?project=" + UrlUtils.urlEncode(projectKey);

    CertificateChainInfo chainInfo = CertificateChains.toModel(chain);

    try {
      ValidateTokenResponse response = doSimpleXmlRequest(HttpMethod.POST, url, chainInfo,
          ValidateTokenResponse.class);

      ValidateAccess access = response.getAccess();
      if (access == null) {
        return null;
      }

      UserValidation userInfo = access.getUser();
View Full Code Here

TOP

Related Classes of org.platformlayer.auth.v1.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.