Package com.google.walkaround.proto.gson

Examples of com.google.walkaround.proto.gson.SignedObjectSessionGsonImpl


   */
  public ObjectSession getVerifiedSession(HttpServletRequest req)
      throws InvalidSecurityTokenException, XsrfTokenExpiredException {
    String rawSessionString = AbstractHandler.requireParameter(req, Params.SESSION);
    log.info("Parsing and verifying signed session " + rawSessionString);
    SignedObjectSessionGsonImpl signedSession;
    try {
      signedSession = GsonProto.fromGson(
          new SignedObjectSessionGsonImpl(), rawSessionString);
    } catch (MessageException e) {
      throw new BadRequestException("Failed to parse signed session", e);
    }
    xsrfHelper.verify(makeAction(signedSession.getSession()), signedSession.getSignature());
    return objectSessionFromProto(signedSession.getSession());
  }
View Full Code Here


    return proto;
  }

  private SignedObjectSessionGsonImpl createSignedSession(ObjectSession session) {
    ObjectSessionProto proto = protoFromObjectSession(session);
    SignedObjectSessionGsonImpl signedSession = new SignedObjectSessionGsonImpl();
    signedSession.setSession(proto);
    signedSession.setSignature(xsrfHelper.createToken(makeAction(proto)));
    return signedSession;
  }
View Full Code Here

   * ConnectResult.
   */
  public ConnectResponseGsonImpl createConnectResponse(
      ObjectSession session, ConnectResult result) {
    ConnectResponseGsonImpl response = new ConnectResponseGsonImpl();
    SignedObjectSessionGsonImpl signedSession = createSignedSession(session);
    response.setSignedSession(signedSession);
    response.setSignedSessionString(GsonProto.toJson(signedSession));
    if (result.getChannelToken() != null) {
      response.setChannelToken(result.getChannelToken());
    }
View Full Code Here

TOP

Related Classes of com.google.walkaround.proto.gson.SignedObjectSessionGsonImpl

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.