[可视化] 单点登录

yhdata_O7wT9qX7青铜四 显示全部楼层 发表于 2023-5-29 11:06:15 |阅读模式 打印 上一主题 下一主题
1
未解决

【可视化】 单点登录

1459 7
单点登录,回调接口按文档去写的。这个报错怎么解决

023-05-26 16:02:20.640] |-[INFO] |-[65b36e49cb9443dfb517b6702de0eb84] |-[__Anyone__] |-[g5.sv.standardsso.SSOLoginFilter.loginWithToken(SSOLoginFilter.java:182)] |-[OTHER:   login with token: 117e89e485a509bbb34d768fc861e3ef]
[2023-05-26 16:02:20.691] |-[INFO] |-[65b36e49cb9443dfb517b6702de0eb84] |-[__Anyone__] |-[g5.sv.standardsso.SSOLoginFilter.postMethod(SSOLoginFilter.java:277)] |-[OTHER:   valid token result: http status code=200, and result=<{"appId":"-1","code":9998,"msg":"发生空指针异常","data":null,"count":null}>]
[2023-05-26 16:02:20.695] |-[WARN] |-[65b36e49cb9443dfb517b6702de0eb84] |-[__Anyone__] |-[g5.sv.standardsso.SSOLoginFilter.doFilter(SSOLoginFilter.java:127)] |-[ERROR: [ErrCode: 0]  sso filter failed!]
java.lang.Exception: Token校验失败


回复

使用道具 举报

精彩评论7

yhdata_yzm 显示全部楼层 发表于 2023-5-29 11:13:05
token校验失败了
回复

使用道具 举报

yhdata_O7wT9qX7青铜四 显示全部楼层 发表于 2023-5-29 11:19:45

具体原因是什么呢?
回复

使用道具 举报

yhdata_yzm 显示全部楼层 发表于 2023-5-29 11:21:04
yhdata_O7wT9qX7 发表于 2023-5-29 11:19
具体原因是什么呢?

看看你怎么写的
回复

使用道具 举报

yhdata_O7wT9qX7青铜四 显示全部楼层 发表于 2023-5-29 11:23:52

    public Map<String, Object> checkTokenForYh(String token, String sysFlag, HttpServletRequest request) {
        String yHtoken = (String) request.getSession().getAttribute("YHtoken");

        if (token.trim().equals(yHtoken.trim()) && sysFlag.trim().equals("fundcrm")) {
            Map<String, Object> map = new HashMap<>();
            map.put("result", "success");
            map.put("userId", "liuzhi12");
            map.put("userAlias", null);
            map.put("userEmail", null);
            map.put("userRoles", null);
            map.put("userGroups", null);
            map.put("param", null);
            return map;
        } else {
            Map<String, Object> map = new HashMap<>();
            map.put("result", "error");
            map.put("userId", null);
            map.put("userAlias", null);
            map.put("userEmail", null);
            map.put("userRoles", null);
            map.put("userGroups", null);
            map.put("param", null);
            return map;
        }

    }


就是和传来的token 做了一下比对,返回个结果




@PostMapping("/fundcrmbiservice")
    @ApiOperation("永洪回调接口")
    @ApiResponse(response = Map.class, message = "success", code = 200)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token"),
            @ApiImplicitParam(name = "sysFlag")
    })
    public Map<String, Object> checkTokenAndFlag(@RequestParam("token") String token,
                                                 @RequestParam("sysFlag") String sysFlag,
                                                 HttpServletRequest request) {

        if ((token == null || token.trim().isEmpty()) ||
                (sysFlag == null || sysFlag.trim().isEmpty())
        ) {
            Map<String, Object> map = new HashMap<>();
            map.put("result", "没有权限");
            map.put("userId", null);
            map.put("userAlias", null);
            map.put("userEmail", null);
            map.put("userRoles", null);
            map.put("userGroups", null);
            map.put("param", null);
            return map;

        } else {
            YongHongService yongHongService = new YongHongServiceImpl();
            return yongHongService.checkTokenForYh(token, sysFlag,request);
        }

    }
回复

使用道具 举报

yhdata_yzm 显示全部楼层 发表于 2023-5-29 13:05:24
yhdata_O7wT9qX7 发表于 2023-5-29 11:23
public Map checkTokenForYh(String token, String sysFlag, HttpServletRequest request) {
        ...

能看到你发出去的请求啥啥样的吗
回复

使用道具 举报

yhdata_O7wT9qX7青铜四 显示全部楼层 发表于 2023-5-29 14:41:05
yhdata_yzm 发表于 2023-5-29 13:05
能看到你发出去的请求啥啥样的吗
  1. POSThttp://127.0.0.1:8087/crm/fundcrmbiservice
  2. Request Method: POST
  3. Request URL: http://127.0.0.1:8087/crm/fundcrmbiservice
  4. Status Code: 200
  5. Request Time: 09:44:57
  6. User-Agent: PostmanRuntime-ApipostRuntime/1.1.0
  7. Cache-Control: no-cache
  8. Accept: */*
  9. Accept-Encoding: gzip, deflate, br
  10. Connection: keep-alive
  11. cookie: JSESSIONID=ABB38085F1F2AD2A4A8C83F3FBDBD264
  12. Content-Type: application/x-www-form-urlencoded
  13. Content-Length: 54

  14. token: 4ae3f98a7811bb71da16f48a7694aaf6
  15. sysFlag: fundcrm
复制代码
回复

使用道具 举报

yhdata_O7wT9qX7青铜四 显示全部楼层 发表于 2023-5-29 14:41:22
感觉没啥问题呀
回复

使用道具 举报

高级模式
您需要登录后才可以回帖 登录 | 免费注册

  • 官方微信

    欢迎关注永洪服务号!收费为0,价值无限

    扫码关注
  • 新浪微博

    让每位用户轻松挖掘数据价值!

    访问新浪微博
  • 智能客服
50W

会员等你来哦

Copyright   ©2012-2024  北京永洪商智科技有限公司  (京ICP备12050607) 京公网安备110110802011451号 |联系社区管理员|《永洪社区协议》
返回顶部