sgtaziz/steamauth
最新稳定版本:1.2.3
Composer 安装命令:
composer require sgtaziz/steamauth
包简介
A package to authenticate using Steam's API.
README 文档
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.
统计信息
- 总下载量: 171
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-13