Package org.platformlayer.auth

Examples of org.platformlayer.auth.DirectAuthenticationToken


      out.trustKeys = Joiner.on(",").join(trustKeys);
    }
    Authenticator authenticator = in.getAuthenticator();
    if (authenticator instanceof DirectAuthenticator) {
      DirectAuthenticator directAuthenticator = (DirectAuthenticator) authenticator;
      DirectAuthenticationToken token = directAuthenticator.getAuthenticationToken();
      out.secret = Secret.build(Hex.toHex(FathomdbCrypto.serialize(token.getSecret())));
      out.token = token.getToken();
    } else {
      throw new UnsupportedOperationException();
    }
    return out;
  }
View Full Code Here


      trustKeys = Lists.newArrayList(Splitter.on(",").split(in.trustKeys));
    }
    {
      String token = in.token;
      CryptoKey secret = FathomdbCrypto.deserializeKey(Hex.fromHex(in.secret.plaintext()));
      DirectAuthenticationToken authenticationToken = new DirectAuthenticationToken(token, secret);
      authenticator = new DirectAuthenticator(authenticationToken);
    }

    PlatformLayerEndpointInfo out = new PlatformLayerEndpointInfo(authenticator, platformlayerBaseUrl, projectId,
        trustKeys);
View Full Code Here

  private DirectAuthenticator buildDirectAuthenticator(ProjectAuthorization project) {
    String auth = DirectAuthenticationToken.encodeToken(project.getId(), project.getName());
    CryptoKey secret = project.getProjectSecret();

    DirectAuthenticationToken token = new DirectAuthenticationToken(auth, secret);
    DirectAuthenticator directAuthenticator = new DirectAuthenticator(token);
    return directAuthenticator;
  }
View Full Code Here

TOP

Related Classes of org.platformlayer.auth.DirectAuthenticationToken

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.