Symfony Bundle to integrate Steam authentication, based on Knojector's work.

Installs: 370

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1


1.0.2 2020-02-20 19:39 UTC

This package is auto-updated.

Last update: 2022-11-21 16:38:59 UTC


A Symfony Bundle that provides authentication via Steam for your application.

Installation & Configuration

Just require the bundle via Composer and use the given flex recipe during the install process.

composer require soljian/steam-authentication-bundle

In your .env file a new entry for your Steam API key was generated. You can obtain your Steam API key here:

login_route The route the user is redirected to after Steam Login

login_redirect The route the user is redirected to if the login was successfull

user_class Classname of your User Entity

request_validator_class Classname of RequestValidatorInterface class. If it isn't set then Soljian\SteamAuthenticationBundle\Security\Authentication\Validator\RequestValidator will be used.

Make sure your User Entity extends from the Soljian\SteamAuthenticationBundle\User\AbstractSteamUser class


namespace App\Entity;

use Soljian\SteamAuthenticationBundle\User\AbstractSteamUser;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\Role\Role;

 * @author Soljian
 * @ORM\Entity()
class User extends AbstractSteamUser
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
    private $id;

     * @return int
    public function getId(): int
        return $this->id;

    public function __construct()
        $this->roles = [];
     * @return array
    public function getRoles(): array
        $roles = [];
        foreach ($this->roles as $role) {
            $roles[] = new Role($role);

        return $roles;

Finally you just have to configure your firewall. A working example might looks like this

            id: Soljian\SteamAuthenticationBundle\Security\User\SteamUserProvider
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
            anonymous: ~
            pattern: ^/
            provider: steam_user_provider
            steam: true
                path:   /logout
                target: /

To display the "Login via Steam" button just include this snippet in your template

{% include '@SoljianSteamAuthentication/login.html.twig' with { 'btn': 1 } %}

You can choose between two images (1 or 2) that will be display as button. Or simply enter your own text.