/**
   * cas 登录
   *
   * @param redirect
   * @param userId
   * @param appKey
   * @param accessToken
   * @param refreshToken
   * @return
   * @throws TaobaoSessionExpiredException
   * @throws TaobaoEnhancedApiException
   * @throws TaobaoOauthException
   * @throws TaobaoAccessControlException
   */
  @RequestMapping(value = "/signIn", method = RequestMethod.POST)
  public String signIn(
      @RequestParam String redirect,
      @RequestParam String nick,
      @RequestParam Long userId,
      @RequestParam String appKey,
      @RequestParam String accessToken,
      @RequestParam String refreshToken)
      throws TaobaoSessionExpiredException, TaobaoEnhancedApiException, TaobaoOauthException,
          TaobaoAccessControlException {

    Subject subject = SecurityUtils.getSubject();
    if (!subject.isAuthenticated()) {
      ShiroTaobaoAuthenticationToken token = new ShiroTaobaoAuthenticationToken();
      token.setNick(nick);
      token.setUserId(userId);
      token.setAppKey(appKey);
      token.setAccessToken(accessToken);
      token.setRefreshToken(refreshToken);
      subject.login(token);
    }
    return "redirect:" + redirect;
  }