{"id":29817222,"url":"https://github.com/ilzrv/laravel-steam-auth","last_synced_at":"2025-07-28T20:12:30.090Z","repository":{"id":43878168,"uuid":"251110013","full_name":"ilzrv/laravel-steam-auth","owner":"ilzrv","description":"Steam Auth for Laravel","archived":false,"fork":false,"pushed_at":"2025-03-16T17:11:02.000Z","size":57,"stargazers_count":17,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-02T21:45:54.600Z","etag":null,"topics":["laravel","laravel-steam","laravel-steam-auth","steam","steam-api","steam-auth","steam-authentication"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ilzrv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-03-29T19:00:41.000Z","updated_at":"2025-04-09T10:15:39.000Z","dependencies_parsed_at":"2024-03-13T09:27:52.309Z","dependency_job_id":"d356901b-7b3f-42db-a1e1-4e1124d7667d","html_url":"https://github.com/ilzrv/laravel-steam-auth","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"23ace0a51aade836df74aab087d526c6eef7ed93"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/ilzrv/laravel-steam-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilzrv%2Flaravel-steam-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilzrv%2Flaravel-steam-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilzrv%2Flaravel-steam-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilzrv%2Flaravel-steam-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ilzrv","download_url":"https://codeload.github.com/ilzrv/laravel-steam-auth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilzrv%2Flaravel-steam-auth/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267578003,"owners_count":24110351,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","laravel-steam","laravel-steam-auth","steam","steam-api","steam-auth","steam-authentication"],"created_at":"2025-07-28T20:12:29.181Z","updated_at":"2025-07-28T20:12:30.083Z","avatar_url":"https://github.com/ilzrv.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Steam Auth for Laravel\n[![Latest Stable Version](https://img.shields.io/packagist/v/ilzrv/laravel-steam-auth.svg)](https://packagist.org/packages/ilzrv/laravel-steam-auth)\n[![Total Downloads](https://img.shields.io/packagist/dt/ilzrv/laravel-steam-auth.svg)](https://packagist.org/packages/ilzrv/laravel-steam-auth)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/ilzrv/laravel-steam-auth/tests.yml)](https://github.com/ilzrv/laravel-steam-auth/actions/workflows/tests.yml)\n[![Codecov](https://img.shields.io/codecov/c/github/ilzrv/laravel-steam-auth?token=MIEA87EZGP)](https://app.codecov.io/github/ilzrv/laravel-steam-auth)\n[![License](https://img.shields.io/github/license/ilzrv/laravel-steam-auth.svg)](https://packagist.org/packages/ilzrv/laravel-steam-auth)\n\nPackage allows you to implement Steam authentication in your Laravel project.\n\n## Requirements\n * Laravel 9+\n * PHP 8.1+\n\n## Installation\n#### Install the package\n```bash\ncomposer require ilzrv/laravel-steam-auth\n```\n\n#### Publish the config file\n```bash\nphp artisan vendor:publish --provider=\"Ilzrv\\LaravelSteamAuth\\ServiceProvider\"\n```\n\n#### Setup Steam API Key(s)\n\nAdd your Steam API key to your `.env` file. You can find it [here](https://steamcommunity.com/dev/apikey).\n\n*if you want to use multiple API keys just list them separated by commas*\n\n```\nSTEAM_AUTH_API_KEYS=YourSteamApiKey1,YourSteamApiKey2\n```\n\n## Tips\n\n#### Client Settings\nYou can use any settings that your client supports, for example, a [Guzzle Proxy](https://docs.guzzlephp.org/en/latest/request-options.html#proxy):\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\Psr7\\HttpFactory;\nuse Illuminate\\Http\\Request;\nuse Ilzrv\\LaravelSteamAuth\\SteamAuthenticator;\n\npublic function __invoke(\n    Request $request,\n    HttpFactory $httpFactory,\n): RedirectResponse {\n    $client = new Client([\n        'proxy' =\u003e 'socks5://user:password@192.168.1.1:1080',\n    ]);\n\n    $steamAuthenticator = new SteamAuthenticator(\n        new Uri($request-\u003egetUri()),\n        $client,\n        $httpFactory,\n    );\n    \n    // Continuation of your code...\n}\n```\n\n#### Proxy Domain\nIf you want to make a proxy domain. Update `redirect_url` inside `steam-auth.php` to your absolute address like `https://auth.test/login`. You can use different domains for the local environment and for production like this:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nreturn [\n    'redirect_url' =\u003e env('APP_ENV', 'production') == 'production'\n        ? 'https://auth.test/login'\n        : null,\n];\n```\n\nIn the NGINX settings for proxy domain, you can specify the following:\n```\nserver {\n    listen 443 ssl http2;\n    server_name auth.test;\n    return 301 https://general.test$uri$is_args$args;\n}\n```\n\n## Basic example\n\nIn `routes/web.php`:\n\n```php\nRoute::get('login', \\App\\Http\\Controllers\\Auth\\SteamAuthController::class);\n```\n\nCreate a controller `SteamAuthController.php`:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nnamespace App\\Http\\Controllers\\Auth;\n\nuse App\\Models\\User;\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\Psr7\\HttpFactory;\nuse GuzzleHttp\\Psr7\\Uri;\nuse Illuminate\\Auth\\AuthManager;\nuse Illuminate\\Http\\RedirectResponse;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Routing\\Redirector;\nuse Ilzrv\\LaravelSteamAuth\\Exceptions\\Authentication\\SteamResponseNotValidAuthenticationException;\nuse Ilzrv\\LaravelSteamAuth\\Exceptions\\Validation\\ValidationException;\nuse Ilzrv\\LaravelSteamAuth\\SteamAuthenticator;\nuse Ilzrv\\LaravelSteamAuth\\SteamUserDto;\n\nfinal class SteamAuthController\n{\n    public function __invoke(\n        Request $request,\n        Redirector $redirector,\n        Client $client,\n        HttpFactory $httpFactory,\n        AuthManager $authManager,\n    ): RedirectResponse {\n        $steamAuthenticator = new SteamAuthenticator(\n            new Uri($request-\u003egetUri()),\n            $client,\n            $httpFactory,\n        );\n\n        try {\n            $steamAuthenticator-\u003eauth();\n        } catch (ValidationException|SteamResponseNotValidAuthenticationException) {\n            return $redirector-\u003eto(\n                $steamAuthenticator-\u003ebuildAuthUrl()\n            );\n        }\n\n        $steamUser = $steamAuthenticator-\u003egetSteamUser();\n\n        $authManager-\u003elogin(\n            $this-\u003efirstOrCreate($steamUser),\n            true\n        );\n\n        return $redirector-\u003eto('/');\n    }\n\n    private function firstOrCreate(SteamUserDto $steamUser): User\n    {\n        return User::firstOrCreate([\n            'steam_id' =\u003e $steamUser-\u003egetSteamId(),\n        ], [\n            'name' =\u003e $steamUser-\u003egetPersonaName(),\n            'avatar' =\u003e $steamUser-\u003egetAvatarFull(),\n            'player_level' =\u003e $steamUser-\u003egetPlayerLevel(),\n            // ...and other what you need\n        ]);\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filzrv%2Flaravel-steam-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filzrv%2Flaravel-steam-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filzrv%2Flaravel-steam-auth/lists"}