首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >google openid登录问题

google openid登录问题
EN

Stack Overflow用户
提问于 2011-08-30 19:25:34
回答 1查看 1.1K关注 0票数 0

我创建了这个模板(用于测试),以便使用google-openid登录:

代码语言:javascript
复制
var t = "https://www.google.com/accounts/o8/id"
    + "?openid.ns=" + encodeURIComponent("http://specs.openid.net/auth/2.0")
    + "&openid.ns.pape=" + encodeURIComponent("http://specs.openid.net/extensions/pape/1.0")
    + "&openid.ns.max_auth_age=300"
    + "&openid.claimed_id=" + encodeURIComponent("http://specs.openid.net/auth/2.0/identifier_select")
    + "&openid.identity=" + encodeURIComponent("http://specs.openid.net/auth/2.0/identifier_select")
    + "&openid.return_to=http://localhost:1033/oauth"
    + "&openid.realm=http://localhost:1033"
    + "&openid.assoc_handle=ABSmpf6DNMw"
    + "&openid.mode=checkid_setup"

    + "&openid.ui.ns=" + encodeURIComponent("http://specs.openid.net/extensions/ui/1.0")
    + "&openid.ui.mode=popup"
    + "&openid.ui.icon=true"

    + "&openid.ns.ax=http://openid.net/srv/ax/1.0"
    + "&openid.ax.mode=fetch_request"
    + "&openid.ax.type.email=http://axschema.org/contact/email"
    + "&openid.ax.type.language=http://axschema.org/pref/language"
    + "&openid.ax.type.namePerson=http://axschema.org/namePerson"
    + "&openid.ax.type.friendly=http://axschema.org/namePerson/friendly"
    + "&openid.ax.type.gender=http://example.com/schema/gender"
    + "&openid.ax.type.timezone=http://axschema.org/pref/timezone"
    + "&openid.ax.required=email,language,namePerson,friendly,gender,timezone";
var openid = {
    signin: function (provider) {
        window.open(t, "Google Login", "location=1,status=1,scrollbars=1, width=700,height=500");
        return false;
    }
};

这在我尝试使用Yahoo时有效,但在本例中,使用Google时,我收到一个xml文档,如下所示:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)">
  <XRD>
  <Service priority="0">
  <Type>http://specs.openid.net/auth/2.0/server</Type>
  <Type>http://openid.net/srv/ax/1.0</Type>
  <Type>http://specs.openid.net/extensions/ui/1.0/mode/popup</Type>
  <Type>http://specs.openid.net/extensions/ui/1.0/icon</Type>
  <Type>http://specs.openid.net/extensions/pape/1.0</Type>
  <URI>https://www.google.com/accounts/o8/ud</URI>
  </Service>
  </XRD>
</xrds:XRDS>

而不是预期的响应!能帮帮我吗,我哪里错了?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-08-31 22:35:35

我更改了以下内容:

代码语言:javascript
复制
var t = "https://www.google.com/accounts/o8/id"

至:

代码语言:javascript
复制
var t = "https://www.google.com/accounts/o8/ud"

问题解决了!

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7242386

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档