sgtaziz / steamauth
A package to authenticate using Steam's API.
Installs: 171
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 2
Open Issues: 1
pkg:composer/sgtaziz/steamauth
Requires
- php: >=5.3.0
- laravel/framework: >=6.0
This package is auto-updated.
Last update: 2025-10-13 03:24:58 UTC
README
- Edit your
composer.jsonto require"sgtaziz/steamauth": "~1.2". - Run
composer updateto download and install the package. - Copy
vendor/sgtaziz/steamauth/src/config/steamauth.phptoconfig/steamauth.php. - Edit
steamauth.phpto include your Steam API key. - Open up
config/app.phpand add'sgtaziz\SteamAuth\SteamAuthServiceProvider'as a service provider. You must also add'SteamAuth' => 'sgtaziz\SteamAuth\Facades\SteamAuth'to aliases.
Documentation
Currently, the only real usable function is SteamAuth::Auth(). Example:
<?php $user = SteamAuth::Auth(); if ($user) { $name = $user['personaname']; $steamid64 = $user['steamid']; echo $name . ' has the steamid ' . $steamid64; }
SteamAuth::Auth() will automatically redirect the user to Steam's website to login. Once authenticated, it will return to the previous page and $user will be a valid variable if Steam was used successfully to authenticate the user. SteamAuth::Auth() will also return an associative array with these values:
Variables of $user
Public Variables
steamid- 64bit SteamID of the usercommunityvisibilitystate- 1 = Private | 2 = Friends Only | 3 = Publicprofilestate- When set to one, means that the user has setup their Steam Community profilepersonaname- The user's Steam aliaslastlogoff- Unix timestamp of when the user was last onlinecommentpermission- When available, it means that anyone can comment on the profileprofileurl- The URL of the user's profileavatar- A small version of the user's avataravatarmedium- A medium version of the user's avataravatarfull- The highest quality version of the user's avatarpersonastate- 0 = Offline | 1 = Online | 2 = Busy | 3 = Away | 4 = Snooze | 5 = Looking to Trade | 6 = Looking to Play
Private Variables
realname- The user's "real name" set on their profileprimaryclanid- The user's primary grouptimecreated- Unix timestamp of the account's creation dategameid- If the user is in a game, the game ID of the game he is currently ingameserverip- When possible, the IP of the server the user is currently ingameextrainfo- The name of the game the user is currently playing
See this for more info.
Note
This is not meant to be used as a way to authenticate users on your website, but simply a way to get their steam information. Once you do that, you may store it in your own database and use that plus SteamAuth to authenticate users.