Sign in with google+ and facebook login in sign page of bagisto ecommerce
-
Hi, can anyone tell me about sign in with google+ and facebook login in sign page of bagisto ecommerce, I have tried with google+ but I am getting like this (404 The Page you are looking for does not exist or have been moved. Navigate using sidemenu.), Please If you have source code then send it to me,Thank You.
config/app.php
I have added Laravel\Socialite\SocialiteServiceProvider::class, in providers and 'Socialite' => Laravel\Socialite\Facades\Socialite::class, in aliases
pakages/Webkul/Shop/src/Http/routes.php
Route::get('login/google', 'Webkul\Customer\Http\Controllers\SessionController@redirectToProvider');
Route::get('login/google/callback', 'Webkul\Customer\Http\Controllers\SessionController@handleProviderCallback');SessionController.php (I have added below two methods)
public function redirectToProvider()
{
return Socialite::driver('google')->redirect();
}/**
-
Obtain the user information from GitHub.
-
@return \Illuminate\Http\Response
*/
public function handleProviderCallback()
{
$user = Socialite::driver('google')->user();return $user->token;
}
In pakages/Webkul/Shop/src/Resources/views/customers/session/index.blade.php
<a href="http://localhost/vayathi/login/google">Login in with Google+</a>
config/services.php
'google' => [
'client_id' => '947267311128-oaohbld4bfs3uph6oavkleotd45rmhe3.apps.googleusercontent.com', // Your GitHub Client ID
'client_secret' => 'L8GXzQHkoQYAtDEQPo-lFe6N', // Your GitHub Client Secret
'redirect' => 'http://localhost/vayathi/login/google/callback',
],0
-
-
Hi,
Your route is as -
Route::get('login/google', 'Webkul\Customer\Http\Controllers\SessionController@redirectToProvider');
Route::get('login/google/callback', 'Webkul\Customer\Http\Controllers\SessionController@handleProviderCallback');
but redirect is -
'redirect' => 'http://localhost/vayathi/login/google/callback',
but it should be - 'redirect' => 'http://localhost/login/google/callback',
link is given -
<a href="http://localhost/vayathi/login/google">Login in with Google+</a>
but it should be, according to route -
<a href="http://localhost/login/google">Login in with Google+</a>
& Make sure your redirect url given during OAuth client ID creation ( https://prnt.sc/oe1th1)
Thanks
-
For More reference follow this link to implement it - https://medium.com/employbl/add-login-with-google-to-your-laravel-app-d2205f01b895
-
thanks, its very helpful