duanliu6083 2019-04-19 07:51
浏览 828

我收到错误“在http://steamcommunity.com/openid上找不到OpenID服务器”

No OpenID Server found at http://steamcommunity.com/openid

steamauth.php

if (isset($_GET['login'])){
    require 'openid.php';
    try {
        require 'SteamConfig.php';
        $openid = new LightOpenID($steamauth['domainname']);

        if(!$openid->mode) {
            $openid->identity = 'http://steamcommunity.com/openid';
            header('Location: ' . $openid->authUrl());
        } elseif ($openid->mode == 'cancel') {
            echo 'User has canceled authentication!';
        } else {
            if($openid->validate()) { 
                $id = $openid->identity;
                $ptn = "/^https:\/\/steamcommunity\.com\/openid\/id\/(7[0-9]{15,25}+)$/";
                preg_match($ptn, $id, $matches);
                include $GLOBALS['env_folder'] . "file_download.php";
                var_dump($matches);
                // die();
                $steamhex = dechex($matches[1]);

                $chardata = get_ftpdata($steamhex);

                if ($chardata != false) {
                    $_SESSION['datafile'] = $chardata;
                    $_SESSION['steamid'] = $matches[1];
                    $_SESSION['version'] = $currentversion;
                    $baninfo = is_currently_banned_on_server($matches[1]);
                    if ($baninfo == false) {
                        add_log($steamhex, "logn");
                        if (!headers_sent()) {
                            header('Location: '.$steamauth['loginpage']);
                            exit;
                        } else {
                            ?>
                            <script type="text/javascript">
                                window.location.href="<?=$steamauth['loginpage']?>";
                            </script>
                            <noscript>
                                <meta http-equiv="refresh" content="0;url=<?=$steamauth['loginpage']?>" />
                            </noscript>
                            <?php
                            exit;
                        }
                    } else {
                        require 'userInfo.php';

                        $webhook = new Client($GLOBALS['discord_hook_faillogin']);

                        $embed = new Embed();
                        $embed->thumbnail($GLOBALS['discord_image_faillogin']);
                        $embed->color(16711680);
                        $embed->title("Failed webpanel login", $GLOBALS['env_url'] . 'character.php?steam=' . dechex($_SESSION['steamid']));
                        $embed->description('A user tried to access the webpanel during his ban.');
                        $embed->field('SteamID', dechex($_SESSION['steamid']), true);
                        $embed->field('Username', $steamprofile['personaname'], true);
                        $embed->field('Time Remaining', secondsToTime($baninfo['duration'] - time()), false);
                        $embed->field('Ban reason', $baninfo['reason'], false);

                        $webhook->embed($embed);

                        try {
                            $webhook->send();
                        } catch (Exception $e) {
                            echo 'Caught exception: ',  $e->getMessage(), "<br />";
                        }

                        session_unset();
                        session_destroy();
                        session_start();
                        add_log($steamhex, "logB");
                        header('Location: '. $GLOBALS['env_url'] . $steamauth['loginpage'] . "?b=1&r=" . urlencode($baninfo['reason']) . "&e=" . $baninfo['duration']);
                        exit;
                    }
                } else {
                    exit;
                }
            } else {
                echo "User is not logged in.
";
            }
        }
    } catch(ErrorException $e) {
        echo $e->getMessage();
    }
}
    function discover($url)
    {
        if (!$url) throw new ErrorException('No identity supplied.');
        # Use xri.net proxy to resolve i-name identities
        if (!preg_match('#^https?:#', $url)) {
            $url = "https://xri.net/$url";
        }

        # We save the original url in case of Yadis discovery failure.
        # It can happen when we'll be lead to an XRDS document
        # which does not have any OpenID2 services.
        $originalUrl = $url;

        # A flag to disable yadis discovery in case of failure in headers.
        $yadis = true;

        # Allows optional regex replacement of the URL, e.g. to use Google Apps
        # as an OpenID provider without setting up XRDS on the domain hosting.
        if (!is_null($this->xrds_override_pattern) && !is_null($this->xrds_override_replacement)) {
            $url = preg_replace($this->xrds_override_pattern, $this->xrds_override_replacement, $url);
        }

        # We'll jump a maximum of 5 times, to avoid endless redirections.
        for ($i = 0; $i < 5; $i ++) {
            if ($yadis) {
                $headers = $this->request($url, 'HEAD', array(), true);

                $next = false;
                if (isset($headers['x-xrds-location'])) {
                    $url = $this->build_url(parse_url($url), parse_url(trim($headers['x-xrds-location'])));
                    $next = true;
                }

                if (isset($headers['content-type']) && $this->is_allowed_type($headers['content-type'])) {
                    # Found an XRDS document, now let's find the server, and optionally delegate.
                    $content = $this->request($url, 'GET');

                    preg_match_all('#<Service.*?>(.*?)</Service>#s', $content, $m);
                    foreach($m[1] as $content) {
                        $content = ' ' . $content; # The space is added, so that strpos doesn't return 0.

                        # OpenID 2
                        $ns = preg_quote('http://specs.openid.net/auth/2.0/', '#');
                        if(preg_match('#<Type>\s*'.$ns.'(server|signon)\s*</Type>#s', $content, $type)) {
                            if ($type[1] == 'server') $this->identifier_select = true;

                            preg_match('#<URI.*?>(.*)</URI>#', $content, $server);
                            preg_match('#<(Local|Canonical)ID>(.*)</\1ID>#', $content, $delegate);
                            if (empty($server)) {
                                return false;
                            }
                            # Does the server advertise support for either AX or SREG?
                            $this->ax   = (bool) strpos($content, '<Type>http://openid.net/srv/ax/1.0</Type>');
                            $this->sreg = strpos($content, '<Type>http://openid.net/sreg/1.0</Type>')
                                       || strpos($content, '<Type>http://openid.net/extensions/sreg/1.1</Type>');

                            $server = $server[1];
                            if (isset($delegate[2])) $this->identity = trim($delegate[2]);
                            $this->version = 2;

                            $this->server = $server;
                            return $server;
                        }

                        # OpenID 1.1
                        $ns = preg_quote('http://openid.net/signon/1.1', '#');
                        if (preg_match('#<Type>\s*'.$ns.'\s*</Type>#s', $content)) {

                            preg_match('#<URI.*?>(.*)</URI>#', $content, $server);
                            preg_match('#<.*?Delegate>(.*)</.*?Delegate>#', $content, $delegate);
                            if (empty($server)) {
                                return false;
                            }
                            # AX can be used only with OpenID 2.0, so checking only SREG
                            $this->sreg = strpos($content, '<Type>http://openid.net/sreg/1.0</Type>')
                                       || strpos($content, '<Type>http://openid.net/extensions/sreg/1.1</Type>');

                            $server = $server[1];
                            if (isset($delegate[1])) $this->identity = $delegate[1];
                            $this->version = 1;

                            $this->server = $server;
                            return $server;
                        }
                    }

                    $next = true;
                    $yadis = false;
                    $url = $originalUrl;
                    $content = null;
                    break;
                }
                if ($next) continue;

                # There are no relevant information in headers, so we search the body.
                $content = $this->request($url, 'GET', array(), true);

                if (isset($this->headers['x-xrds-location'])) {
                    $url = $this->build_url(parse_url($url), parse_url(trim($this->headers['x-xrds-location'])));
                    continue;
                }

                $location = $this->htmlTag($content, 'meta', 'http-equiv', 'X-XRDS-Location', 'content');
                if ($location) {
                    $url = $this->build_url(parse_url($url), parse_url($location));
                    continue;
                }
            }

            if (!$content) $content = $this->request($url, 'GET');

            # At this point, the YADIS Discovery has failed, so we'll switch
            # to openid2 HTML discovery, then fallback to openid 1.1 discovery.
            $server   = $this->htmlTag($content, 'link', 'rel', 'openid2.provider', 'href');
            $delegate = $this->htmlTag($content, 'link', 'rel', 'openid2.local_id', 'href');
            $this->version = 2;

            if (!$server) {
                # The same with openid 1.1
                $server   = $this->htmlTag($content, 'link', 'rel', 'openid.server', 'href');
                $delegate = $this->htmlTag($content, 'link', 'rel', 'openid.delegate', 'href');
                $this->version = 1;
            }

            if ($server) {
                # We found an OpenID2 OP Endpoint
                if ($delegate) {
                    # We have also found an OP-Local ID.
                    $this->identity = $delegate;
                }
                $this->server = $server;
                return $server;
            }

            throw new ErrorException("No OpenID Server found at $url", 404);
        }
        throw new ErrorException('Endless redirection!', 500);
    }

This is the function that I think the error is being thrown at. Some reports I have gotten states to try and go to the openid link specified, and if it downloads a file it should be fine, and it does download a file, but I don't specifically know what I am looking for.

The research I have done, is it's caused by the web hosting company, however, this setup has worked for the last 2 years, and now just randomly stopped working today. Other than that, other people had it just start working randomly for them, no real rhyme or reason.

One solution that was offered was to try and change the http to https, and that had not worked. Other than that, I am unsure.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥16 mybatis的代理对象无法通过@Autowired装填
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂
    • ¥15 wordpress 产品图片 GIF 没法显示
    • ¥15 求三国群英传pl国战时间的修改方法
    • ¥15 matlab代码代写,需写出详细代码,代价私
    • ¥15 ROS系统搭建请教(跨境电商用途)
    • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。