PHPackages                             jacobfitz/steamauth - 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. jacobfitz/steamauth

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

jacobfitz/steamauth
===================

Implement Steam login within your PHP project

1.0(5y ago)019MITPHPPHP &gt;=7.2

Since May 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/JacobFitzpatrick-dev/SteamAuth)[ Packagist](https://packagist.org/packages/jacobfitz/steamauth)[ RSS](/packages/jacobfitz-steamauth/feed)WikiDiscussions main Synced 3w ago

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

SteamAuth
=========

[](#steamauth)

SteamAuth allows you to implement steam sign-in within your PHP project.
It is simple, fast, and secure...

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

[](#installation)

Install with composer:

```
composer require jacobfitz/steamauth

```

Request
-------

[](#request)

To log a user in you must first make a request.

```
$request = new \SteamAuth\Request('API_KEY', 'RETURN_URL');

/* Option 1: Redirect the user */
$request->redirectToLogin();

/* Option 2: Present the user with a link or login button */
echo 'Login with Steam';
```

**API\_KEY** - This is your steam developer API key, you can find it by going to
**RETURN\_URL** - The URI on your website where the user will be returned to on successful login. For example if your website is example.com and you want to proccess the response on example.com/proc\_login, you will only need to pass `proc_login` to the request constructor - Do not use full URL's!

The user will be redirected to the steam login page, once they sign in with their steam account they will be returned to the return URL specified with a response from steam.

**Note**: If you choose to use a steam login button you must consult and adhere to the steam brand guidelines.

Response
--------

[](#response)

When the user is returned to your site after logging in with steam you will need to handle the response, an example of how this is done can be found bellow.

```
$response = new \SteamAuth\Response('API_KEY');

/* Check if the response is valid */
if ($response->isValid()) {

    /**
     * At this point the user is now logged in.
     * Their data will automatically be saved to the session.
     */

    /* Get the steam user */
    $user = $response->getUser();
} else {

    /* Get errors */
    $errors = $response->getErrors();
}
```

User
----

[](#user)

Once a request has been made, and the response has been handled you will be able to access information about the user. SteamAuth comes with a handy class to make working with the steam user easy, but if you prefer to use your own implementation you can get all the information you need from the `$_SESSION['steamAuth']` variable.

### Check if the user is logged in

[](#check-if-the-user-is-logged-in)

To check if a steam user is currently logged in you can do:

```
if (\SteamAuth\User::isLoggedIn()) {
    doSomeStuff();
}
```

### Get the user

[](#get-the-user)

To get a currently logged-in user you can do:

```
$user = \SteamAuth\User::getCurrent();
```

### Reload the user

[](#reload-the-user)

User details are not automatically updated, meaning it may be necessary to fetch the latest information from steam. This can be done by simply doing:

```
$user->reload();
```

### Get user information

[](#get-user-information)

To get information about a user you can use a variety of methods. Bellow is an example of how each can be used:

```
/* Directly access an attribute, see ATTRIBUTE_* constants for options */
$user->getAttribute($user::ATTRIBUTE_USERNAME);

// --------------- Steam ID ---------------
$user->getSteamID();

// --------------- Username ---------------
$user->getUsername();

// --------------- Avatar ---------------
$user->getAvatar();

/* Specify size */
$user->getAvatar($user::AVATAR_SIZE_MEDIUM);

// --------------- Status ---------------
$user->getStatus();
/* Check status */
if ($user->checkStatus($user::STATE_ONLINE)) {
    doSomeStuff();
}

// --------------- Real Name ---------------
/* This isn't always visible, check is is first */
if ($user->hasRealName()) {
    /* Get real name */
    $user->getRealName();
}

// --------------- Profile URL ---------------
$user->getURL();

// --------------- Community Profile ---------------
$user->isCommunityProfile();

// --------------- Time ---------------
/* Get account creation time */
$user->getTimeCreated();
/* Get last logoff time */
$user->getLastLogOffTime();

// --------------- Visibility ---------------
$user->getVisibility();
/* Check visibility */
if ($user->checkVisibility($user::VISIBILITY_PUBLIC)) {
    doSomeStuff();
}

// --------------- Logout ---------------
\SteamAuth\User::logout();
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

1862d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/780c761e3f0522b0200da41fd247e494ecfd4c745bb50517b8f15828628fd1b0?d=identicon)[JacobFitzp](/maintainers/JacobFitzp)

---

Top Contributors

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

---

Tags

openidphpsteamvalve

### Embed Badge

![Health badge](/badges/jacobfitz-steamauth/health.svg)

```
[![Health](https://phpackages.com/badges/jacobfitz-steamauth/health.svg)](https://phpackages.com/packages/jacobfitz-steamauth)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)[better-futures-studio/filament-local-logins

This is my package filament-local-logins

1334.6k](/packages/better-futures-studio-filament-local-logins)

PHPackages © 2026

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