Git Product home page Git Product logo

protobuf-steam-auth's Introduction

Protobuf-Steam-Auth

Latest Stable Version Total Downloads Visitors count License

To use this package you need to install php extension protobuf. Installation instructions are below.

About Protobuf Steam Auth

This package provides the ability to authorize to the Steam using Google Protobuf. Support PHP 7+ and PHP 8+.

Installation

  1. Run this text in a console to install this package from Packagist:
composer require allyans3/protobuf-steam-auth
  1. Copy folder protobuf-ext from /vendor/allyans3/protobuf-steam-auth to your project:
cp -a /vendor/allyans3/protobuf-steam-auth/protobuf-ext .
  1. Build php extension with next commands choosing between php 7 and php 8 (Thanks to Tankonyako):
cd protobuf-ext/php7 // For PHP 7
cd protobuf-ext/php8 // For PHP 8

For Linux/Mac:

phpize
./configure
make
make install

For Windows see this Youtube video:

  1. Add line extension=protobuf.so to your php.ini file

Usage

use SteamAuth\SteamAuth;

require "vendor/autoload.php";

$auth = new SteamAuth('login', '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)

Cookie storage

By default, cookie saves in $cookieStorage attribute and can be retrieved by getCookies() or getCookiesByHost() methods.

Optional, you can specify the path to your cookie file in cookie_file key.

Also, you can send your cookies as array to cookie_storage key.

use SteamAuth\SteamAuth;

require "vendor/autoload.php";

$cookieOptions = [
    '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);

Handle Exceptions

use SteamAuth\SteamAuth;

require "vendor/autoload.php";

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

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

Proxy

v1.0.9 or later is required to use proxy.

Keys that can be in an array:

  • ip + port or domain_namedomain_name used for rotating proxy
  • user + pass – if proxy support auth
  • type – you can pass constant variable or integer as explained in table below
  • timeout – in seconds, default infinite
  • connect_timeout – in seconds, default infinite
  • user_agent – your Useragent
cURL Proxy Type Integer
CURLPROXY_HTTP 0
CURLPROXY_HTTP_1_0 1
CURLPROXY_HTTPS 2
CURLPROXY_SOCKS4 4
CURLPROXY_SOCKS4A 6
CURLPROXY_SOCKS5 5
CURLPROXY_SOCKS5_HOSTNAME 7

Example:

use SteamAuth\SteamAuth;

require "vendor/autoload.php";

$proxy = [
    'ip' => '49.12.181.264',
    'port' => 8000,
    'user' => 'user',
    'pass' => 'pass'
];

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

$auth->setProxy($proxy);

$auth->login();

Support

Report bugs on the issue tracker.

License

Protobuf Steam Auth is open-sourced Composer package licensed under the MIT license.

protobuf-steam-auth's People

Contributors

allyans3 avatar ftsu-ua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

protobuf-steam-auth's Issues

This is a stub file for IDEs, don't use it directly!

Hi, thank you for your efforts in managing this repo.

The installation instructions are not working for PHP 8.2. The make commands are specifically bombing out with incorrect arguments given to functions.

I've managed to install the protobuf extension using sudo apt install php8.2-protobuf, but I still see This is a stub file for IDEs, don't use it directly!.

Originally posted by @scheMeZa in #1 (comment)

Step 3 not enough tutorial

@Allyans3 helpppppppppp, I cant install the command

phpize
./configure
make
make install

its not working for me

Do I make a file protobuf.so?
and put a code inside it

cd protobuf-ext/php8

phpize
./configure
make
make install

@Allyans3 help me pleaseeee 😩

About .proto question

Could you tell me where the .proto files?
Im reference about three repository.
SteamTracking
SteamKit
Protobufs
Most of the protobuf files were found. However, some data raised a 'parseError.' Additionally, some attributes, for example, CAuthentication_BeginAuthSessionViaCredentials_Response, do not have the 'client_id' attribute.

Email Verify Code

Hi ,The parameter used to control the sending of a verification code to the email during login is which one? I'm not receiving the verification code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.