Package org.osforce.connect.entity.oauth

Examples of org.osforce.connect.entity.oauth.Authorization


  @RequestMapping(value="/authorized", method=RequestMethod.GET)
    public @ResponseBody Map<String, Object> isAuthorized(
        @RequestParam String target, HttpSession session) {
    Long userId = (Long) session.getAttribute(AttributeKeys.USER_ID_KEY);
    Authorization authorization = authorizationService.getAuthorization(target, userId);
    //
    Map<String, Object> model = CollectionUtil.newHashMap();
    model.put("authorized", authorization!=null);
      return model;
    }
View Full Code Here


    Long userId = (Long) session.getAttribute(AttributeKeys.USER_ID_KEY);
    Token requestToken = requestTokens.get(oauth_token);
    Verifier verifier = new Verifier(oauth_verifier);
    OAuthService oAuthService = oAuthServices.get(requestToken);
    Token accessToken = oAuthService.getAccessToken(requestToken, verifier);
    Authorization authorization = new Authorization(
                    target,
                    accessToken.getToken(),
                    accessToken.getSecret(),
                    userId);
    authorizationService.createAuthorization(authorization);
View Full Code Here

      }
    }
  }

  private Token getAccessToken(String target, User user) {
    Authorization authorization = authorizationService.getAuthorization(target, user.getId());
    return new Token(authorization.getToken(), authorization.getSecret());
  }
View Full Code Here

TOP

Related Classes of org.osforce.connect.entity.oauth.Authorization

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.