Ejemplo n.º 1
0
  @RequestMapping(value = "/authorization")
  public String authorization(@RequestParam("code") String code, HttpSession session) {
    String url = "redirect:/";

    try {
      Token tokenInfo = oauthService.getToken(code);
      if (tokenInfo != null) {
        UserVO user = oauthService.getUserInfo(tokenInfo);
        session.setAttribute("userInfo", user);
      }
    } catch (Exception e) {
      logger.error(e.getMessage(), e);
    }
    return url;
  }