Contents of Steam
// This assumes that you have composer installed globally composer require socialiteproviders/steam
2. Service Provider
config\app.phpif you have added it already.
'providers' => [ // a whole bunch of providers // remove 'Laravel\Socialite\SocialiteServiceProvider', \SocialiteProviders\Manager\ServiceProvider::class, // add ];
- Note: If you would like to use the Socialite Facade, you need to install it.
3. Add the Event and Listeners
SocialiteProviders\Manager\SocialiteWasCalledevent to your
Add your listeners (i.e. the ones from the providers) to the
SocialiteProviders\Manager\SocialiteWasCalledthat you just created.
The listener that you add for this provider is
Note: You do not need to add anything for the built-in socialite providers unless you override them with your own providers.
/** * The event handler mappings for the application. * * @var array */ protected $listen = [ \SocialiteProviders\Manager\SocialiteWasCalled::class => [ // add your listeners (aka providers) here 'SocialiteProviders\Steam\SteamExtendSocialite@handle', ], ];
4. Environment Variables
If you add environment values to your .env as exactly shown below, you do not need to add an entry to the services array.
Append provider values to your
// other values above STEAM_KEY=yourapikeyfortheservice STEAM_REDIRECT_URI=https://example.com/login
You do not need to add this if you add the values to the .env exactly as shown above.
The values below are provided as a convenience in the case that a developer is not able to use the
'steam' => [ // the client_id key is required, even though it isn't utilised by the Steam provider 'client_id' => null, 'client_secret' => env('STEAM_KEY'), 'redirect' => env('STEAM_REDIRECT_URI'), ],
- You should now be able to use it like you would regularly use Socialite (assuming you have the facade installed):
You can use Socialite providers with Lumen. Just make sure that you have facade support turned on and that you follow the setup directions properly.
Also, configs cannot be parsed from the
services in Lumen. You can only set the values in the
.env file as shown exactly in this document. If needed, you can
also override a config (shown below).
Overriding a config
If you need to override the provider’s environment or config variables dynamically anywhere in your application, you may use the following:
$clientKey = "apikey"; $redirectUrl = "http://yourdomain.com/api/redirect"; $additionalProviderConfig = ['site' => 'meta.stackoverflow.com']; $config = new \SocialiteProviders\Manager\Config(null, $clientKey, $redirectUrl, $additionalProviderConfig); return Socialite::with('steam')->setConfig($config)->redirect();