PHP Steam Login
Forked from Ehesp/Steam-Login to focus on being specific and updated for Laravel., (*1)
This package enables you to easily log users in via Steam, using their OpenID service. However, this package does not require that you have the OpenID PHP module installed!, (*2)
Note: The package can also easily be used with the Laravel 5.3+ PHP Framework., (*3)
Installation
Begin by installing this package via Composer:, (*4)
{
"require": {
"captbrogers/steam-login": "~1.0"
}
}
Add Service Provider and Facade
If you're using the Laravel 5.3+ PHP Framework, add the following to your config/app.php file's providers array:, (*5)
Captbrogers\SteamLogin\Laravel\SteamLoginServiceProvider::class,
And the following to your aliases array in the same file:, (*6)
'SteamLogin' => Captbrogers\SteamLogin\Laravel\Facades\SteamLogin::class,
You now have access to the SteamLogin facade., (*7)
Usage
Before starting, please note you're unable to redirect a user to the Steam OpenID login portal. In other words, they must be able to click the link themselves., (*8)
Use the SteamLogin class and create a new instance of it:, (*9)
// view.blade.php
<a href="{{ SteamLogin::url() }}">Login via Steam!</a>
To validate the Steam Login:, (*10)
// routes/web.php
Route::get('/', function()
{
return SteamLogin::validate();
});
Changing the return URL
The return URL must be a valid URL which contains either the http or https URI scheme., (*11)
If you want your users to be sent to a specific URL/route after login, this is easily done. Simply add the URL as a parameter in the url() method:, (*12)
// config/services.php
'steam' => [
'login' => 'http://mywebsite.com/login',
],
Then simply access this in the url method:, (*13)
SteamLogin::url(config(('services.steam.login'));
To Do