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

ActiveLibrary

yodaylay22/laravel-steam-auth
=============================

Laravel Steam Auth

01PHP

Since May 20Pushed 2y agoCompare

[ Source](https://github.com/yodaylay22/laravel-steam-auth)[ Packagist](https://packagist.org/packages/yodaylay22/laravel-steam-auth)[ RSS](/packages/yodaylay22-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.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

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 58.9% 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/bb8b717ed1185a1d1e0d5358a1a9b34612b50203f431d037c8e1cad18aaf3a25?d=identicon)[Yodaylay22](/maintainers/Yodaylay22)

---

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)")[![grandsilence](https://avatars.githubusercontent.com/u/9817522?v=4)](https://github.com/grandsilence "grandsilence (3 commits)")[![Mahmoudz](https://avatars.githubusercontent.com/u/1983984?v=4)](https://github.com/Mahmoudz "Mahmoudz (3 commits)")[![timetorock](https://avatars.githubusercontent.com/u/6104856?v=4)](https://github.com/timetorock "timetorock (3 commits)")[![luukholleman](https://avatars.githubusercontent.com/u/1071025?v=4)](https://github.com/luukholleman "luukholleman (3 commits)")[![innerspirit](https://avatars.githubusercontent.com/u/305197?v=4)](https://github.com/innerspirit "innerspirit (2 commits)")[![alexevladgabriel](https://avatars.githubusercontent.com/u/59282365?v=4)](https://github.com/alexevladgabriel "alexevladgabriel (1 commits)")[![yodaylay22](https://avatars.githubusercontent.com/u/12820569?v=4)](https://github.com/yodaylay22 "yodaylay22 (1 commits)")[![kaizer666](https://avatars.githubusercontent.com/u/260150742?v=4)](https://github.com/kaizer666 "kaizer666 (1 commits)")[![kai-zer-ru](https://avatars.githubusercontent.com/u/4065357?v=4)](https://github.com/kai-zer-ru "kai-zer-ru (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)")[![Tim-NL](https://avatars.githubusercontent.com/u/6275800?v=4)](https://github.com/Tim-NL "Tim-NL (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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