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

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

hapore/laravel-steam-auth
=========================

Laravel Steam Auth

v1.0.0(9mo ago)13MITPHPPHP ^7.2|^8.0|^8.3

Since Sep 13Pushed 9mo agoCompare

[ Source](https://github.com/hapore/laravel-steam-auth)[ Packagist](https://packagist.org/packages/hapore/laravel-steam-auth)[ RSS](/packages/hapore-laravel-steam-auth/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (2)Used By (0)

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

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

[![Code Climate](https://camo.githubusercontent.com/b588821d1a929422b15461afe9c33aed3d0b1a748fa354ec9c64e44ea6023e33/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6861706f72652f6c61726176656c2d737465616d2d617574682f6261646765732f6770612e737667)](https://codeclimate.com/github/hapore/laravel-steam-auth)[![Latest Stable Version](https://camo.githubusercontent.com/1fef0dc9e5f9e1278169314d88bdf8b879c91a5e1c90c1409ab70fb932017265/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6861706f72652f6c61726176656c2d737465616d2d617574682e737667)](https://packagist.org/packages/hapore/laravel-steam-auth)[![Total Downloads](https://camo.githubusercontent.com/d9532e197242ab7942c079c001d697c14a7eb06b9437cf3034b89869d144f894/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6861706f72652f6c61726176656c2d737465616d2d617574682e737667)](https://packagist.org/packages/hapore/laravel-steam-auth)[![License](https://camo.githubusercontent.com/af68eb02d8c5ebf2ae8685244f8f129cfcefe859f26aca24f0b46298d6d5b00f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6861706f72652f6c61726176656c2d737465616d2d617574682e737667)](https://packagist.org/packages/hapore/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 hapore/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="Hapore\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 Hapore\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

33

—

LowBetter than 72% of packages

Maintenance56

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

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

295d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/110359720?v=4)[Junior](/maintainers/prahzera)[@prahzera](https://github.com/prahzera)

---

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)")[![prahzera](https://avatars.githubusercontent.com/u/110359720?v=4)](https://github.com/prahzera "prahzera (4 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)")[![luk1337](https://avatars.githubusercontent.com/u/6830979?v=4)](https://github.com/luk1337 "luk1337 (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)")[![alexevladgabriel](https://avatars.githubusercontent.com/u/59282365?v=4)](https://github.com/alexevladgabriel "alexevladgabriel (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/hapore-laravel-steam-auth/health.svg)

```
[![Health](https://phpackages.com/badges/hapore-laravel-steam-auth/health.svg)](https://phpackages.com/packages/hapore-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)
