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

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

boraguler/laravel-steam-auth
============================

Laravel Steam Auth

v1.0(1y ago)06MITPHPPHP ^7.2|^8.0

Since Mar 20Pushed 1y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (5)Versions (2)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.2+
- Laravel 5.8+

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

[](#installation)

#### Via Composer

[](#via-composer)

```
composer require invisnik/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="Invisnik\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

28

—

LowBetter than 54% of packages

Maintenance46

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

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

416d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a10f5dbdf1d5426faba8ad475664b44d056951002dec3b2c30ba521becd1f01?d=identicon)[boraguler](/maintainers/boraguler)

---

Top Contributors

[![invisnik](https://avatars.githubusercontent.com/u/7964397?v=4)](https://github.com/invisnik "invisnik (83 commits)")[![Gummibeer](https://avatars.githubusercontent.com/u/6187884?v=4)](https://github.com/Gummibeer "Gummibeer (16 commits)")[![atoff](https://avatars.githubusercontent.com/u/17804618?v=4)](https://github.com/atoff "atoff (11 commits)")[![chriskonnertz](https://avatars.githubusercontent.com/u/4319323?v=4)](https://github.com/chriskonnertz "chriskonnertz (7 commits)")[![Mahmoudz](https://avatars.githubusercontent.com/u/1983984?v=4)](https://github.com/Mahmoudz "Mahmoudz (3 commits)")[![luukholleman](https://avatars.githubusercontent.com/u/1071025?v=4)](https://github.com/luukholleman "luukholleman (3 commits)")[![grandsilence](https://avatars.githubusercontent.com/u/9817522?v=4)](https://github.com/grandsilence "grandsilence (3 commits)")[![timetorock](https://avatars.githubusercontent.com/u/6104856?v=4)](https://github.com/timetorock "timetorock (3 commits)")[![innerspirit](https://avatars.githubusercontent.com/u/305197?v=4)](https://github.com/innerspirit "innerspirit (2 commits)")[![kai-zer-ru](https://avatars.githubusercontent.com/u/4065357?v=4)](https://github.com/kai-zer-ru "kai-zer-ru (1 commits)")[![boraguler](https://avatars.githubusercontent.com/u/22474910?v=4)](https://github.com/boraguler "boraguler (1 commits)")[![kaizer666](https://avatars.githubusercontent.com/u/260150742?v=4)](https://github.com/kaizer666 "kaizer666 (1 commits)")[![alexevladgabriel](https://avatars.githubusercontent.com/u/59282365?v=4)](https://github.com/alexevladgabriel "alexevladgabriel (1 commits)")[![luk1337](https://avatars.githubusercontent.com/u/6830979?v=4)](https://github.com/luk1337 "luk1337 (1 commits)")[![metroyanno](https://avatars.githubusercontent.com/u/12733387?v=4)](https://github.com/metroyanno "metroyanno (1 commits)")[![nikkiii](https://avatars.githubusercontent.com/u/891176?v=4)](https://github.com/nikkiii "nikkiii (1 commits)")[![RonMelkhior](https://avatars.githubusercontent.com/u/1017721?v=4)](https://github.com/RonMelkhior "RonMelkhior (1 commits)")[![techieforfun](https://avatars.githubusercontent.com/u/53330046?v=4)](https://github.com/techieforfun "techieforfun (1 commits)")

---

Tags

laravelauthsteam

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M347](/packages/tymon-jwt-auth)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M52](/packages/php-open-source-saver-jwt-auth)[invisnik/laravel-steam-auth

Laravel Steam Auth

171160.6k1](/packages/invisnik-laravel-steam-auth)[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)[codegreencreative/laravel-samlidp

Make your PHP Laravel application an Identification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

263763.5k1](/packages/codegreencreative-laravel-samlidp)[jurager/teams

Laravel package to manage team functionality and operate with user permissions.

22817.3k](/packages/jurager-teams)

PHPackages © 2026

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