For a project I'm working on, i was planning to add a Steam Auth process. Now I came across Socialite Providers and I followed this documentation. Now I'm running into some problems and I don't understand how to solve this issue.
Services.php
'steam' => [
'client_id' => null,
'client_secret' => env('STEAM_CLIENT_SECRET'),
'redirect' => env('STEAM_REDIRECT_URI'),
'allowed_hosts' => [
'localhost:8000',
]
],
ENV
STEAM_CLIENT_SECRET=WEB-API-KEY
STEAM_REDIRECT_URI=/login
Web.php
Route::get('/auth/steam', 'App\Http\Controllers\Auth\LoginController@Steam');
Route::get('/auth/steam/redirect', 'App\Http\Controllers\Auth\LoginController@SteamRedirect');
LoginController
public function Steam()
{
return Socialite::driver('steam')->redirect();
}
public function SteamRedirect()
{
$user = Socialite::driver('steam')->user();
$user = User::where([
'steam_id' => $user->id
])->first();
if (!$user) {
return redirect('/login');
}
Auth::Login($user, true);
return redirect('/home');
}
After coming from the Steam Auth Login page, I get this url and get back to the login screen like:
http://localhost:8000/?openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.mode=id_res&openid.op_endpoint=https%3A%2F%2Fsteamcommunity.com%2Fopenid%2Flogin&openid.claimed_id=https%3A%2F%2Fsteamcommunity.com%2Fopenid%2Fid%2F76XXXXXXXXXXXXXXX&openid.identity=https%3A%2F%2Fsteamcommunity.com%2Fopenid%2Fid%2F76XXXXXXXXXXXXXXX&openid.return_to=http%3A%2F%2Flocalhost%3A8000&openid.response_nonce=2022-12-15T19%3A38%3A51ZWnjBUmEd8lftIfIVbWMVlPcLydY%3D&openid.assoc_handle=1234567890&openid.signed=signed%2Cop_endpoint%2Cclaimed_id%2Cidentity%2Creturn_to%2Cresponse_nonce%2Cassoc_handle&openid.sig=wm4PzO2begrHfPDTlEKkGSPh%2BBE%3D
How do I solve this problem so that the user logs in successfully?
Thanks in advance!