Package com.google.api.client.extensions.auth.helpers

Examples of com.google.api.client.extensions.auth.helpers.ThreeLeggedFlow


      throws IOException, ServletException {
    PersistenceManager pm = getPersistenceManagerFactory().getPersistenceManager();

    String userId = getUserId();

    ThreeLeggedFlow oauthFlow = newFlow(userId);
    oauthFlow.setJsonFactory(getJsonFactory());
    oauthFlow.setHttpTransport(getHttpTransport());

    try {
      Credential cred = oauthFlow.loadCredential(pm);

      if (cred != null && cred.isInvalid()) {
        pm.deletePersistent(cred);
        cred = null;
      }
View Full Code Here


    String userId = getUserId();

    // Get flow from the data store
    PersistenceManager manager = pmf.getPersistenceManager();
    try {
      ThreeLeggedFlow flow = null;
      try {
        flow = manager.getObjectById(flowType, userId);
      } catch (JDOObjectNotFoundException e) {
        LOG.severe("Unable to locate flow by user: " + userId);
        resp.setStatus(HttpServletResponse.SC_NOT_FOUND);
        resp.getWriter().print("Unable to find flow for user: " + userId);
        return;
      }

      flow.setHttpTransport(getHttpTransport());
      flow.setJsonFactory(getJsonFactory());

      // Complete the flow object with the token we got in our query parameters
      Credential c = flow.complete(completionCode);
      manager.makePersistent(c);
      manager.deletePersistent(flow);
      resp.sendRedirect(redirectUrl);
    } finally {
      manager.close();
View Full Code Here

TOP

Related Classes of com.google.api.client.extensions.auth.helpers.ThreeLeggedFlow

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.