开发者社区 问答 正文

JopenId 的问题 - 服务问题

今天在做JopenID google 登录 以及yahoo登录时候

老是重定向URL过去后 发生请求的URL无效,这种提示 请问我代码有问题吗?

还是说缺少什么东西了。谢谢 各位大侠

测试代码如下:

Endpoint endpoint = manager.lookupEndpoint("Google");
Association association = manager.lookupAssociation(endpoint);
request.getSession().setAttribute(ATTR_MAC, association.getRawMacKey());
request.getSession().setAttribute(ATTR_ALIAS, endpoint.getAlias());
String url = manager.getAuthenticationUrl(endpoint, association);
HttpServletResponse response = ServletActionContext.getResponse();
response.setContentType("text/html; charset=UTF-8");
response.sendRedirect(url);

展开
收起
montos 2020-05-30 11:25:25 272 分享 版权
1 条回答
写回答
取消 提交回答
  • 把详细的异常信息贴出来瞧瞧吧。

    另外:第7行代码是多余的

    ######

    第七行代码已经删了, 代码运行不报错 它从定向到Google网站以后

    Google网站提示我 这个链接无效,不知道为什么

    ######现在 gmail 经常被不间断的墙哦,概率相当之高,很有可能你就被Q了
    ######

    但是,我改用socialauth运行就正常,只是用 socialauth 在用户点击同意协议以后 返回过来取不到用户的具体资料,很头疼。哎 一个是链接无效,一个是返回参数无聊,难道真就不让我完成这个功能吗? 救命啊

    ###### 我在执行manager.lookupAssociation是报错了 ,说http://www.google.com/.../o8/ui is unreachable
    2020-05-30 11:25:33
    赞同 展开评论
问答分类:
问答地址: