Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Allyans3 committed Dec 4, 2022
0 parents commit b92b92f
Show file tree
Hide file tree
Showing 26 changed files with 11,886 additions and 0 deletions.
120 changes: 120 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Created by .ignore support plugin (hsz.mobi)
### Composer template
composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock

### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
/.idea
/.idea/*
.idea/
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Windows template
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

/example
/example/*

composer.lock

/tmp/
/tmp/*

index.php
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<p align="center"><a href="https://github.com/Allyans3/protobuf-steam-auth" target="_blank"><img src="https://raw.githubusercontent.com/Allyans3/protobuf-steam-auth/master/images/protobuf-steam-auth-logo.png" width="600" alt="Protobuf-Steam-Auth"></a></p>

<p align="center">
<a href="https://packagist.org/packages/Allyans3/protobuf-steam-auth"><img src="https://img.shields.io/packagist/v/Allyans3/protobuf-steam-auth?style=flat-square&logo=Composer" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/Allyans3/protobuf-steam-auth"><img src="https://img.shields.io/packagist/dt/Allyans3/protobuf-steam-auth?style=flat-square&logo=Composer" alt="Total Downloads"></a>
<a href="https://github.com/Allyans3/protobuf-steam-auth"><img src="https://img.shields.io/packagist/l/Allyans3/protobuf-steam-auth?style=flat-square&color=3555555" alt="License"></a>
</p>

## About Protobuf Steam Auth

This package provides the ability to authorize to the Steam using Google Protobuf.

## Installation

Run this text in a console to install this package from Packagist:

```
composer require allyans3/protobuf-steam-auth
```

## Usage

```php
use SteamAuth\SteamAuth;

require "vendor/autoload.php";

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

$auth->login();

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

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

```

## Handle Exceptions

```php
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();
}
```

## Support

Report bugs on the [issue tracker](https://github.com/Allyans3/protobuf-steam-auth/issues).

## License

Protobuf Steam Auth is open-sourced Composer package licensed under the [MIT license](https://opensource.org/licenses/MIT).
25 changes: 25 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "allyans3/protobuf-steam-auth",
"description": "description",
"minimum-stability": "stable",
"license": "proprietary",
"authors": [
{
"name": "allyans3",
"email": "[email protected]"
}
],
"require": {
"allegro/php-protobuf": "^0.12.4",
"php-curl-class/php-curl-class": "^9.10",
"doctormckay/steam-totp": "^1.0"
},
"autoload": {
"psr-4": {
"SteamAuth\\": "src/"
}
},
"require-dev": {
"symfony/var-dumper": "^5.4"
}
}
Binary file added images/protobuf-steam-auth-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
132 changes: 132 additions & 0 deletions src/Configs/SteamConfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<?php

namespace SteamAuth\Configs;

class SteamConfig
{
const CODES = [
1 => "OK",
2 => "Fail",
3 => "NoConnection",
4 => "NoConnectionRetry",
5 => "InvalidPassword",
6 => "LoggedInElsewhere",
7 => "InvalidProtocolVer",
8 => "InvalidParam",
9 => "FileNotFound",
10 => "Busy",
11 => "InvalidState",
12 => "InvalidName",
13 => "InvalidEmail",
14 => "DuplicateName",
15 => "AccessDenied",
16 => "Timeout",
17 => "Banned",
18 => "AccountNotFound",
19 => "InvalidSteamID",
20 => "ServiceUnavailable",
21 => "NotLoggedOn",
22 => "Pending",
23 => "EncryptionFailure",
24 => "InsufficientPrivilege",
25 => "LimitExceeded",
26 => "Revoked",
27 => "Expired",
28 => "AlreadyRedeemed",
29 => "DuplicateRequest",
30 => "AlreadyOwned",
31 => "IPNotFound",
32 => "PersistFailed",
33 => "LockingFailed",
34 => "LogonSessionReplaced",
35 => "ConnectFailed",
36 => "HandshakeFailed",
37 => "IOFailure",
38 => "RemoteDisconnect",
39 => "ShoppingCartNotFound",
40 => "Blocked",
41 => "Ignored",
42 => "NoMatch",
43 => "AccountDisabled",
44 => "ServiceReadOnly",
45 => "AccountNotFeatured",
46 => "AdministratorOK",
47 => "ContentVersion",
48 => "TryAnotherCM",
49 => "PasswordRequiredToKickSession",
50 => "AlreadyLoggedInElsewhere",
51 => "Suspended",
52 => "Cancelled",
53 => "DataCorruption",
54 => "DiskFull",
55 => "RemoteCallFailed",
56 => "PasswordUnset",
57 => "ExternalAccountUnlinked",
58 => "PSNTicketInvalid",
59 => "ExternalAccountAlreadyLinked",
60 => "RemoteFileConflict",
61 => "IllegalPassword",
62 => "SameAsPreviousValue",
63 => "AccountLogonDenied",
64 => "CannotUseOldPassword",
65 => "InvalidLoginAuthCode",
66 => "AccountLogonDeniedNoMail",
67 => "HardwareNotCapableOfIPT",
68 => "IPTInitError",
69 => "ParentalControlRestricted",
70 => "FacebookQueryError",
71 => "ExpiredLoginAuthCode",
72 => "IPLoginRestrictionFailed",
73 => "AccountLockedDown",
74 => "AccountLogonDeniedVerifiedEmailRequired",
75 => "NoMatchingURL",
76 => "BadResponse",
77 => "RequirePasswordReEntry",
78 => "ValueOutOfRange",
79 => "UnexpectedError",
80 => "Disabled",
81 => "InvalidCEGSubmission",
82 => "RestrictedDevice",
83 => "RegionLocked",
84 => "RateLimitExceeded",
85 => "AccountLoginDeniedNeedTwoFactor",
86 => "ItemDeleted",
87 => "AccountLoginDeniedThrottle",
88 => "TwoFactorCodeMismatch",
89 => "TwoFactorActivationCodeMismatch",
90 => "AccountAssociatedToMultiplePartners",
91 => "NotModified",
92 => "NoMobileDevice",
93 => "TimeNotSynced",
94 => "SmsCodeFailed",
95 => "AccountLimitExceeded",
96 => "AccountActivityLimitExceeded",
97 => "PhoneActivityLimitExceeded",
98 => "RefundToWallet",
99 => "EmailSendFailure",
100 => "NotSettled",
101 => "NeedCaptcha",
102 => "GSLTDenied",
103 => "GSOwnerDenied",
104 => "InvalidItemType",
105 => "IPBanned",
106 => "GSLTExpired",
107 => "InsufficientFunds",
108 => "TooManyPending",
109 => "NoSiteLicensesFound",
110 => "WGNetworkSendExceeded",
111 => "AccountNotFriends",
112 => "LimitedUserAccount",
113 => "CantRemoveItem",
114 => "AccountDeleted",
115 => "ExistingUserCancelledLicense",
116 => "CommunityCooldown",
117 => "NoLauncherSpecified",
118 => "MustAgreeToSSA",
119 => "LauncherMigrated",
120 => "SteamRealmMismatch",
121 => "InvalidSignature",
122 => "ParseFailure",
123 => "NoVerifiedPhone"
];
}
10 changes: 10 additions & 0 deletions src/Exceptions/SteamErrorException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace SteamAuth\Exceptions;

use Exception;

class SteamErrorException extends Exception
{

}
10 changes: 10 additions & 0 deletions src/Exceptions/SteamResponseException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace SteamAuth\Exceptions;

use Exception;

class SteamResponseException extends Exception
{

}
Loading

0 comments on commit b92b92f

Please sign in to comment.