PHP code example of allyans3 / protobuf-steam-auth

1. Go to this page and download the library: Download allyans3/protobuf-steam-auth library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

allyans3 / protobuf-steam-auth example snippets


use SteamAuth\SteamAuth;

ogin', 'password', 'shared_secret');

// For proxy
$auth->setProxy($proxy);

// For WebBrowser
$auth->login();
// or for MobileApp
$auth->loginMobile();

// You can check if you are authorized
$auth->isAuthorized();

// If auth `true` you can get cookies
$auth->getCookies();
// or by host
$auth->getCookiesByHost();

// Getting data for platform type
$auth->getDataForPlatformType(1) // 1 => Steam Client, 2 => Web Browser, 3 => Mobile App

// Updating `access_token` with `refresh_token`
$auth->updateAccessToken($refreshToken)

// Decoding JWT
$auth->decodeJWT($token)


use SteamAuth\SteamAuth;

cookie_file' => 'path_to_cookie_file',
    
    'cookie_storage' => [
        "steamcommunity.com" => [
            "sessionid"         => "*******",
            "steamCountry"      => "*******",
            "steamLoginSecure"  => "*******"
        ],
        "store.steampowered.com" => [
            "sessionid"         => "*******",
            "steamLoginSecure"  => "*******"
        ],
        "help.steampowered.com" => [
            "sessionid"         => "*******",
            "steamLoginSecure"  => "*******"
        ],
        "steam.tv" => [
            "sessionid"         => "*******",
            "steamCountry"      => "*******",
            "steamLoginSecure"  => "*******"
        ],
        "checkout.steampowered.com" => [
            "steamLoginSecure"  => "*******"
        ]       
    ]   
];

$auth = new SteamAuth('login', 'password', 'shared_secret', $cookieOptions);

use SteamAuth\SteamAuth;

ogin', 'password', 'shared_secret');

try {
    $auth->login();
} catch (\SteamAuth\Exceptions\SteamErrorException $e) {
    $e->getMessage();
} catch (\SteamAuth\Exceptions\SteamResponseException $e) {
    $e->getMessage();
}

use SteamAuth\SteamAuth;

49.12.181.264',
    'port' => 8000,
    'user' => 'user',
    'pass' => 'pass'
];

$auth = new SteamAuth('login', 'password', 'shared_secret');

$auth->setProxy($proxy);

$auth->login();


cd protobuf-ext/php7 // For PHP 7
cd protobuf-ext/php8 // For PHP 8