PHPackages                             truckersmp/laravel-steam-auth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. truckersmp/laravel-steam-auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

truckersmp/laravel-steam-auth
=============================

Laravel Steam Auth - TruckersMP

v3.5.1(5y ago)03.3kMITPHPPHP &gt;=5.6.0

Since Dec 3Pushed 5y ago1 watchersCompare

[ Source](https://github.com/TruckersMP/laravel-steam-auth-old)[ Packagist](https://packagist.org/packages/truckersmp/laravel-steam-auth)[ RSS](/packages/truckersmp-laravel-steam-auth/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Steam authentication for Laravel 5
==================================

[](#steam-authentication-for-laravel-5)

[![Code Climate](https://camo.githubusercontent.com/3856521fe68a8ab79f24c7c05d6e991b9ecb2dbe2dc5b59d094fb146357ea7a7/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f747275636b6572736d702f6c61726176656c2d737465616d2d617574682f6261646765732f6770612e737667)](https://codeclimate.com/github/truckersmp/laravel-steam-auth)[![Latest Stable Version](https://camo.githubusercontent.com/0e13f0c575034d34a1ec452818e8b0ee212468aad52f86642b1553c8e40547a6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f747275636b6572736d702f6c61726176656c2d737465616d2d617574682e737667)](https://packagist.org/packages/truckersmp/laravel-steam-auth)[![Total Downloads](https://camo.githubusercontent.com/61d94dfa213ca73b677db223ca3335b7c906426dd8b44f6c93a208574371015b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f747275636b6572736d702f6c61726176656c2d737465616d2d617574682e737667)](https://packagist.org/packages/truckersmp/laravel-steam-auth)[![License](https://camo.githubusercontent.com/28c87ec24852ffda78b83899a7aef73514704088074d60d766d98174301c778a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f747275636b6572736d702f6c61726176656c2d737465616d2d617574682e737667)](https://packagist.org/packages/truckersmp/laravel-steam-auth)

This package is a Laravel 5 service provider which provides support for Steam OpenID and is very easy to integrate with any project that requires Steam authentication.

Installation Via Composer
-------------------------

[](#installation-via-composer)

Add this to your `composer.json` file, in the require object:

```
"truckersmp/laravel-steam-auth": "3.*"
```

After that, run `composer install` to install the package.

#### Laravel 5.4 and below

[](#laravel-54-and-below)

Add the service provider to `app/config/app.php`, within the `providers` array.

```
'providers' => [
	// ...
	Invisnik\LaravelSteamAuth\SteamServiceProvider::class,
]
```

The package is automatically added if you are in Laravel 5.5.

#### Steam API Key

[](#steam-api-key)

Add your Steam API key to your `.env` file. You can get your API key [here](http://steamcommunity.com/dev/apikey).

```
STEAM_API_KEY=SomeKindOfAPIKey

```

#### Config Files

[](#config-files)

Lastly, publish the config file.

```
php artisan vendor:publish

```

Usage example
-------------

[](#usage-example)

In `config/steam-auth.php`:

```
return [

    /*
     * Redirect URL after login
     */
    'redirect_url' => '/auth/steam/handle',
    /*
     * Realm override. Bypass domain ban by Valve. Use alternative domain with redirection to main for authentication (banned by valve).
     */
    // 'realm' => 'redirected.com',
    /*
     *  API Key (set in .env file) [http://steamcommunity.com/dev/apikey]
     */
    'api_key' => env('STEAM_API_KEY', ''),
    /*
     * Is using https?
     */
    'https' => false,
];
```

In `routes/web.php`:

```
Route::get('auth/steam', 'AuthController@redirectToSteam')->name('auth.steam');
Route::get('auth/steam/handle', 'AuthController@handle')->name('auth.steam.handle');
```

**Note:** if you want to keep using Laravel's default logout route, add the following as well:

```
Route::post('logout', 'Auth\LoginController@logout')->name('logout');
```

In `AuthController`:

```
namespace App\Http\Controllers;

use Invisnik\LaravelSteamAuth\SteamAuth;
use App\User;
use Auth;

class AuthController extends Controller
{
    /**
     * The SteamAuth instance.
     *
     * @var SteamAuth
     */
    protected $steam;

    /**
     * The redirect URL.
     *
     * @var string
     */
    protected $redirectURL = '/';

    /**
     * AuthController constructor.
     *
     * @param SteamAuth $steam
     */
    public function __construct(SteamAuth $steam)
    {
        $this->steam = $steam;
    }

    /**
     * Redirect the user to the authentication page
     *
     * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
     */
    public function redirectToSteam()
    {
        return $this->steam->redirect();
    }

    /**
     * Get user info and log in
     *
     * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
     */
    public function handle()
    {
        if ($this->steam->validate()) {
            $info = $this->steam->getUserInfo();

            if (!is_null($info)) {
                $user = $this->findOrNewUser($info);

                Auth::login($user, true);

                return redirect($this->redirectURL); // redirect to site
            }
        }
        return $this->redirectToSteam();
    }

    /**
     * Getting user by info or created if not exists
     *
     * @param $info
     * @return User
     */
    protected function findOrNewUser($info)
    {
        $user = User::where('steamid', $info->steamID64)->first();

        if (!is_null($user)) {
            return $user;
        }

        return User::create([
            'username' => $info->personaname,
            'avatar' => $info->avatarfull,
            'steamid' => $info->steamID64
        ]);
    }
}
```

Should you wish to use a login redirection URL that is differant from the one you specified in the config

```
// Inside your controller login method
$this->steam->setRedirectUrl(route('login.route'));

...

return $this->steam->redirect();
```

If you need another steamID you can use another package to convert the given steamID64 to another type like [xPaw/SteamID](https://github.com/xPaw/SteamID.php).

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2039d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1501705?v=4)[CJMAXiK](/maintainers/cjmaxik)[@cjmaxik](https://github.com/cjmaxik)

---

Top Contributors

[![cjmaxik](https://avatars.githubusercontent.com/u/1501705?v=4)](https://github.com/cjmaxik "cjmaxik (4 commits)")

---

Tags

laravelauthsteam

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/truckersmp-laravel-steam-auth/health.svg)

```
[![Health](https://phpackages.com/badges/truckersmp-laravel-steam-auth/health.svg)](https://phpackages.com/packages/truckersmp-laravel-steam-auth)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
