Member Since 4 Years Ago
3,770 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Started a new Conversation Socialite Google Works On Localhost Only
Hi guys, I asked about issues with Google oauth a while back but got no answers, and made some progress in the meantime.
I have facebook and google login using socialite, facebook works but google I've only managed to get to work locally, so for example locally the url is http://dev.thesite.com and in production the url is https://thesite.com, that's the only difference, however when trying to log in with google in production i always get the invalidState exception
I managed to make some "progress" by setting the callback url to be https://www.thesite.com//login/google/callback
instead of just /login/google/callback
and also having www
in the url in the google api console for the callback, then I don't get an error but I am redirected wrongly to /index.php
and I am not really signed in.
My .htaccess
files redirects all requests to https
, I believe that maybe some server setting is the issue here, did you guys have any similar experiences?
Started a new Conversation Socalite Google Sign In Get Name
I am using Laravel
and its Socialite
package to log in via Facebook
and Google
on my comments page so that users don't have to type out their name and email.
However, I am having issues with Google
(Facebook
works fine).
Specifically for Google (Facebook works) I get an InvalidStateException
.
However if I comment out profile
in $scopes
array in file '/vendor/laravel/socialite/src/Two/GoogleProvider.php`
so it looks like:
protected $scopes = [
'openid',
//'profile',
'email',
];
Then login works, however then I don't have access to name
which I really need.
Replied to Laravel Socalite - HandleProviderCallback Is Never Triggered
Yea I hear you, thanks for all the help.
Replied to Laravel Socalite - HandleProviderCallback Is Never Triggered
OK friend we're getting there.
I am not using php artisan serve, I am using wamp and I run the app on localhost:3000 with browser sync / web pack, so not sure if I need to change anything there?
Ok I changed the redirect in my services.php, and in Valid OAuth Redirect URIs
I now have http://localhost:3000//login/facebook/callback
( I do read what you say, I also tried changing it to http://localhost:8000//login/facebook/callback
however now I get a new error on facebook website:
Facebook has detected olja isn't using a secure connection to transfer information.
So even though I am on localhost and in development mode I get this message.
Yea I just read your last post, not sure if http will work even on localhost.
Replied to Laravel Socalite - HandleProviderCallback Is Never Triggered
@audunru I actually do have a redirect now, though thanks for letting me know it's the way to go, however still the problem of the method not being triggered persists.
I don't understand how am I supposed to be redirected to the callback route when facebook as you say does not connect to it. I think I might need to edit something in my facebook app or in services.php
.
Please bear with me as I don't have much experience with this.
These are my routes:
Route::get('login/facebook', 'Auth\[email protected]');
Route::get('login/facebook/callback', 'Auth\[email protected]');
The actual website runs on http://localhost:3000/
In services.php
I have
'facebook' => [
'client_id' => 'myid',
'client_secret' => 'mysecret',
'redirect' => 'http://localhost/',
],
On my facebook app, I have localhost
set for my App Domains
(under Settings/Basic
) and on that same page at the bottom I've added a website platform
with site url
of http://localhost:3000/
Under Products/Facebook Login/Settings
, Valid OAuth Redirect URIs
is empty.
Please tell me what needs changing? I tried changing my redirect
in services.php
to http://localhost:3000/login/facebook/callback
however this gives me some error when trying to log in.
I also tried setting 'Valid OAuth Redirect URIs' to http://localhost:3000/login/facebook/callback
but it won't accept it (I guess because of https)
So, my guess is I need to change my redirect in services.php
and have that same redirect in Valid OAuth Redirect URIs
, is that correct? If so, how do I do that on localhost? It seems to deman https for Valid OAuth Redirect URIs
Replied to Laravel Socalite - HandleProviderCallback Is Never Triggered
Hi, are you sure?
Yes I am testing locally, but I don't think that's the issue.I think Facebook supports local development.
I think I do get logged in. I get a "state" session variable after logging in via facebook, and also I've implemented this facebook login locally without a framework or socialite (just 2 php scripts) and it worked fine.
Started a new Conversation Laravel Socalite - HandleProviderCallback Is Never Triggered
I am trying to log a user in via Facebook and then use that user data to fill out the name and email in a comment form.
I am using Laravel / Socialite
.
So in my LoginController
I have this:
public function redirectToProvider()
{
return Socialite::driver('facebook')->redirect();
}
public function handleProviderCallback(Request $request)
{
$user = Socialite::driver('facebook')->user();
$request->session()->put('user', $user);
}
By using breakpoints in both methods I came to the conclusion that the handleProviderCallback
method is actually never triggered for some reason.