JanRain PHP OpenID:如何检查提供程序是否以编程方式支持AX?(JanRain PHP OpenID: How to check if a provider supports AX p

编程入门 行业动态 更新时间:2024-10-07 22:19:05
JanRain PHP OpenID:如何检查提供程序是否以编程方式支持AX?(JanRain PHP OpenID: How to check if a provider supports AX programmatically?)

好吧,我的问题是有些提供商支持SREG而有些支持只有AX我需要知道我是如何向提供商请求他们支持哪些方法..我试着查看这里的文档http://openidenabled.com/ files / php-openid / docs / 2.1.3 /但我什么也没看到。

Ok, my problem is that some providers support SREG and some support only AX I need to know how it is that I can request from the provider which methods they support.. I tried looking through the documentation here http://openidenabled.com/files/php-openid/docs/2.1.3/ but I didn't see anything.

最满意答案

面临类似的问题。

以下代码应该可以帮助您。

因此,如果

function getReturnTo() { return sprintf("%s://%s:%s%s/finish_auth.php", getScheme(), $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], dirname($_SERVER['PHP_SELF'])); } function &getConsumer() { /** * Create a consumer object using the store object created * earlier. */ $store = getStore(); $consumer =& new Auth_OpenID_Consumer($store); return $consumer; } $consumer = getConsumer(); $return_to = getReturnTo(); $response = $consumer->complete($return_to); $sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($response); $ax = new Auth_OpenID_AX_FetchResponse(); $obj = $ax->fromSuccessResponse($response); if($sreg) { //sreg is supported, start creating the sreg data array. } elseif($obj) { // attribute exchange supported. fetch details here }

这将帮助您诊断即将发生的数据,SREG或Atribute Exchange

Faced similar problem.

The below code should help you.

So if

function getReturnTo() { return sprintf("%s://%s:%s%s/finish_auth.php", getScheme(), $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], dirname($_SERVER['PHP_SELF'])); } function &getConsumer() { /** * Create a consumer object using the store object created * earlier. */ $store = getStore(); $consumer =& new Auth_OpenID_Consumer($store); return $consumer; } $consumer = getConsumer(); $return_to = getReturnTo(); $response = $consumer->complete($return_to); $sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($response); $ax = new Auth_OpenID_AX_FetchResponse(); $obj = $ax->fromSuccessResponse($response); if($sreg) { //sreg is supported, start creating the sreg data array. } elseif($obj) { // attribute exchange supported. fetch details here }

this will help you diagnose which data is coming, SREG or Atribute Exchange

更多推荐

本文发布于:2023-07-30 16:04:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1338799.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:方式   程序   PHP   OpenID   JanRain

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!