gpt4 book ai didi

php-openID 不适用于雅虎

转载 作者:可可西里 更新时间:2023-11-01 12:34:41 24 4
gpt4 key购买 nike

我正在尝试使用 php-openid 库在我的站点中实现 openID。其包中的基本消费者示例不适用于 Google 和 Yahoo。我在这里找到了谷歌解决方案: Example usage of AX in PHP OpenID但它仍然不适用于 Yahoo! .我怎样才能让它发挥作用?

最佳答案

哇,现在解决了!!!!

我跟踪了函数并发现了问题。那就是......在我使用的“try_auth.php”文件中

"$attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/contact/email',2,1, 'email');" 

用于从提供商处获取用户电子邮件。它在 Google 中运行良好,因为 Google 忽略“2”(请求的电子邮件地址的计数),但在 Yahoo!它为它生成 [count.email] => 2(在 getSignedNS 函数中)并且在 Yahoo 响应中没有 count.email 的条目。它导致在雅虎的 getSignedNS 中返回 null。我变了

"$attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/contact/email',2,1, 'email');"

"$attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/contact/email',1,1, 'email');" 

它现在工作正常,并返回我从两个提供商那里请求的任何东西!!!

大声笑...

关于php-openID 不适用于雅虎,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2616123/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com