Jump to content
Sign in to follow this  
heimWerker

Problema API Steam Authentication

Recommended Posts

Salut, am venit si eu cu o problema legata de SteamAuth.

Problema este ca nu ma pot conecta cu Steam-ul pe propriul Site deoarece imi da "No OpenID Server found at steamcommunity.com/openid".

Am modificat in steamauth/settings.php -> API key-ul si Domaniname. Credeti-ma ca am facut tot ce stiu si nu mai rezist cu problema asta. Multi imi spun ca nu stiu ce legatura dintre site si steam nu este facuta alti spun ca nu stiu ce are scriptul, chiar nu mai stiu pe cine si ce sa cred. Am nevoie de un om care se pricepe bine si ma poate ajuta. Multumesc.

Share this post


Link to post
Share on other sites

Ce aplicatie/script folosesti mai exact? Ceva creat de tine cu API-ul de la Steam sau ceva luat de pe GitHub gen:

https://github.com/SmItH197/SteamAuthentication

As vrea sa stiu pentru simplu fapt ca spui ca ai modificat:

Am modificat in steamauth/settings.php -> API key-ul si Domaniname

 Nu am lucreat cu API-ul de la Steam deloc, dar incearca sa postezi macar un exemplu despre ce date trimiti spre API-ul de la Steam si ce eroare iti da mai exact, m-ar mira ca oamenii de la steam sa aiba o eroare asa basica precum un simplu mesaj, ceva un cod de eroare numeric sau cum le afiseaza ei.

Daca e sa postezi datele ce trimiti spre API, incearca sa nu postezi si API key-ul care e folosit la conexiune. Daca crezi ca preferi sa nu vada toata lumea datele trimise, trimite-mi un PM aici.


PHP Developer - Not available for freelancing right now

Daca ai de gand sa postezi la categoria IPB, nu uita sa citesti regulamentul: Link regulament

Share this post


Link to post
Share on other sites

steamauth/settings.php (apikey-ul este facut de mine aia cu cenzurat asa si la domainname cu **** sa nu se considere reclama si sa imi pastrez secret apikey-ul)

<?php
$steamauth['apikey'] = "52807DE666D17F308967EE8DCENZURAT"; // Your Steam WebAPI-Key found at http://steamcommunity.com/dev/apikey
$steamauth['domainname'] = "www.g****s.ro"; // The main URL of your website displayed in the login page
$steamauth['buttonstyle'] = ""; // Style of the login button [small|large_no|large]
$steamauth['logoutpage'] = ""; // Page to redirect to after a successfull logout (from the directory the SteamAuth-folder is located in) - NO slash at the beginning!
$steamauth['loginpage'] = ""; // Page to redirect to after a successfull login (from the directory the SteamAuth-folder is located in) - NO slash at the beginning!


// System stuff
if (empty($steamauth['apikey'])) {die("<div style='display: block; width: 100%; background-color: red; text-align: center;'>SteamAuth:<br>Please supply an API-Key!</div>");}
if (empty($steamauth['domainname'])) {$steamauth['domainname'] = "localhost";}
if ($steamauth['buttonstyle'] != "small" and $steamauth['buttonstyle'] != "large") {$steamauth['buttonstyle'] = "large_no";}
?>

server01/steamauth.php

<?php
ob_start();
session_start();
require ('server01/openid.php');


function logoutbutton() {
    echo "<form action=\"server01/logout.php\" method=\"post\"><input value=\"Logout\" type=\"submit\" /></form>"; //logout button
}

function steamlogin()
{
try {
    require("settings.php");
    $openid = new LightOpenID($steamauth['g*****s.ro']);

    $button['small'] = "small";
    $button['large_no'] = "large_noborder";
    $button['large'] = "large_border";
    $button = $button[$steamauth['buttonstyle']];
    
    if(!$openid->mode) {
        if(isset($_GET['login'])) {
            $openid->identity = 'https://steamcommunity.com/openid';
            header('Location: ' . $openid->authUrl());
        }

    return "<form action=\"?login\" method=\"post\"> <input type=\"image\" src=\"http://cdn.steamcommunity.com/public/images/signinthroughsteam/sits_".$button.".png\"></form>";
    }

     elseif($openid->mode == 'cancel') {
        echo 'User has canceled authentication!';
    } else {
        if($openid->validate()) { 
                $id = $openid->identity;
                $ptn = "/^http:\/\/steamcommunity\.com\/openid\/id\/(7[0-9]{15,25}+)$/";
                preg_match($ptn, $id, $matches);
              
                $_SESSION['steamid'] = $matches[1]; 

                // First determine of the $steamauth['loginpage'] has been set, if yes then redirect there. If not redirect to where they came from
                if($steamauth['loginpage'] !== "") {
                    $returnTo = $steamauth['loginpage'];
                } else {
                    //Determine the return to page. We substract "login&"" to remove the login var from the URL.
                    //"file.php?login&foo=bar" would become "file.php?foo=bar"
                    $returnTo = str_replace('login&', '', $_GET['openid_return_to']);
                    //If it didn't change anything, it means that there's no additionals vars, so remove the login var so that we don't get redirected to Steam over and over.
                    if($returnTo === $_GET['openid_return_to']) $returnTo = str_replace('?login', '', $_GET['openid_return_to']);
                }
                header('Location: '.$returnTo);
        } else {
                echo "User is not logged in.\n";
        }

    }
} catch(ErrorException $e) {
    echo $e->getMessage();
}
}

?>

Erori nu imi da decat de chat care nu are nicio legatura cu SteamAuthentication.

Share this post


Link to post
Share on other sites

De ce la randu:

 $openid = new LightOpenID($steamauth['g*****s.ro']);

Ii trimiti domainanem-ul in array-ul ala?

Acolo ar trebui sa-i treci tot array-ul de configuratie $steamauth.

$openid = new LightOpenID($steamauth);

PHP Developer - Not available for freelancing right now

Daca ai de gand sa postezi la categoria IPB, nu uita sa citesti regulamentul: Link regulament

Share this post


Link to post
Share on other sites

Atunci va trebui sa vezi clar daca esti la ultima versiune a script-ului care folosesti si sa sti sigur ca nu are probleme. Daca e facut de tine, fa un debug la cod cum ti-am explicat in primu post, sau na, macar incearca sa faci un debug si sa postezi datele ce ti-am cerut chiar daca nu e facut de tine tot codu.

http://blog.teamtreehouse.com/how-to-debug-in-php


PHP Developer - Not available for freelancing right now

Daca ai de gand sa postezi la categoria IPB, nu uita sa citesti regulamentul: Link regulament

Share this post


Link to post
Share on other sites

Atunci va trebui sa vezi clar daca esti la ultima versiune a script-ului care folosesti si sa sti sigur ca nu are probleme. Daca e facut de tine, fa un debug la cod cum ti-am explicat in primu post, sau na, macar incearca sa faci un debug si sa postezi datele ce ti-am cerut chiar daca nu e facut de tine tot codu.

http://blog.teamtreehouse.com/how-to-debug-in-php

Am verificat este totul ok cu script-ul de la Steam. Poti incerca sa faci tu conectarea cu localhost si steam? Poate la tine merge si imi oferi si mie exact ce ai facut si ramane doar sa modific eu.

PS: Sau macar daca ma poti ajuta pe mine.

Edited by heimWerker

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...