PHPackages                             minestorecms/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. minestorecms/laravel-steam-auth

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

minestorecms/laravel-steam-auth
===============================

Laravel Steam Auth

02PHP

Since Feb 23Pushed 1y agoCompare

[ Source](https://github.com/MineStoreCMS/laravel-steam-auth)[ Packagist](https://packagist.org/packages/minestorecms/laravel-steam-auth)[ RSS](/packages/minestorecms-laravel-steam-auth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

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

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

[![Code Climate](https://camo.githubusercontent.com/ccf277bc9dcd7d0c60edf548a85b2312cf50e33332c33d347534c2212c160404/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f696e7669736e696b2f6c61726176656c2d737465616d2d617574682f6261646765732f6770612e737667)](https://codeclimate.com/github/invisnik/laravel-steam-auth)[![Latest Stable Version](https://camo.githubusercontent.com/c5a807d34beb05d88afcf1ef35221d26bc394b0e1fd2dec19526433b00a17cf4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e7669736e696b2f6c61726176656c2d737465616d2d617574682e737667)](https://packagist.org/packages/invisnik/laravel-steam-auth)[![Total Downloads](https://camo.githubusercontent.com/532b4b93a8de94e515a13c6960a0288e179a9e676d1ec7a0731e03d68d217697/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e7669736e696b2f6c61726176656c2d737465616d2d617574682e737667)](https://packagist.org/packages/invisnik/laravel-steam-auth)[![License](https://camo.githubusercontent.com/0d6f7e57ad7d75278680a5f9dd579d66d588c55a7af2d41337947dc43b294e02/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f696e7669736e696b2f6c61726176656c2d737465616d2d617574682e737667)](https://packagist.org/packages/invisnik/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.

Requirements
------------

[](#requirements)

- PHP 7+
- Laravel 10+

Installation
------------

[](#installation)

#### Via Composer

[](#via-composer)

```
composer require teh9/laravel-steam-auth
```

#### 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)

Publish the config file.

```
php artisan vendor:publish --provider="Teh9\LaravelSteamAuth\SteamServiceProvider"

```

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

15

—

LowBetter than 3% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 Bus Factor1

Top contributor holds 57.1% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c29fe8ce682859e6341fbdebe5a1a9dfe7c2da479fd1c0b208366abad9e4331b?d=identicon)[MineStoreCMS](/maintainers/MineStoreCMS)

---

Top Contributors

[![the-gusev](https://avatars.githubusercontent.com/u/53116227?v=4)](https://github.com/the-gusev "the-gusev (4 commits)")[![MineStoreCMS](https://avatars.githubusercontent.com/u/102915789?v=4)](https://github.com/MineStoreCMS "MineStoreCMS (3 commits)")

### Embed Badge

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

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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