使用 Janrain 的 PHP OpenID 库从查询字符串获取值

发布于 2024-10-01 05:17:24 字数 722 浏览 0 评论 0 原文

我正在使用 Janrains PHP openID 库。一切都工作正常,除非我尝试从用户授权后返回的脚本上的查询字符串中提取值。

这是查询字符串的第一部分:

http://localhost/Cloudshare/trunk/Cloudshare/php/openID/recieve_auth_request.php?    janrain_nonce=2010-11-08T22:29:59Zp9PTgs&openid.ns=http://specs.openid.net/auth/2.0&openid.mode=id_res&openid.op_endpoint=https://www.google.com/accounts/o8/ud.

我能够获取查询字符串上“janrain_nonce”项的值,但无法获取“openid.op_endpoint”等内容的任何值。

例如,

$test = $_GET["janrain_nonce"];

返回一个值 ok 到 $test 中,但是使用以下命令 $test 的值是空白...

$test = $_GET["openid.claimed_id"];

我想做的是从查询字符串中获取值之一,看看它是否包含“google”,因为我有一些特定于谷歌的处理要做。

非常感谢任何帮助。

谢谢。

I am using Janrains PHP openID library. All is working perfectly except when I try and pull values from the query string on the script that is returned to after the user is authorized.

Here is the first part of the query string:

http://localhost/Cloudshare/trunk/Cloudshare/php/openID/recieve_auth_request.php?    janrain_nonce=2010-11-08T22:29:59Zp9PTgs&openid.ns=http://specs.openid.net/auth/2.0&openid.mode=id_res&openid.op_endpoint=https://www.google.com/accounts/o8/ud.

I am able to get the value of the 'janrain_nonce' item on the query string, but am not able to get any values for things like 'openid.op_endpoint'..

For example, this

$test = $_GET["janrain_nonce"];

returns a value ok into $test, but the the value of $test is blank using the following...

$test = $_GET["openid.claimed_id"];

What I am trying to do is get one of the values from the query string to see if it contains 'google' or not, as I have some processing specific to Google to do.

Any help is much appreciated.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

窗影残 2024-10-08 05:17:24

我在您的查询字符串中没有看到 openid.claimed_id ,但尝试获取 $_GET['openid_claimed_id'];

在我的 API 似乎表明“.”正在转换为“_”FWIW

我已经确认了这一点。 var.var2 转换为 var_var2 请参阅

http://api.fatherstorm.com/?query&test_is[]=1&test.is[]=2

I didn't see openid.claimed_id in your querystring, but try getting $_GET['openid_claimed_id'];

testing your querystring at my API seems to indicate that the "." is being converted to "_" FWIW

I've confirmed that. var.var2 gets converted to var_var2 see

http://api.fatherstorm.com/?query&test_is[]=1&test.is[]=2

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文