Perfect!!!! Thank you so much... Just an update : in your line 29 we need to change it to " $gauth=new Google\Service\Oauth2($client);" that is how it wotks nowadays.
ay man this was super helpful any beginner could've followed along, other tutorials say that it's for beginners and assumes that you have composer but this is something else, cheers 🥂
why did I get this error : Authorization Error Error 400: invalid_request Invalid parameter value for approval_prompt: 'auto'' is not valid after clicking the 'login with Google' button?
hello, do you have an idea how resolve the error 500 ? i have this same error in localhost and production. before it s work now no . i search everywhere, it's annoying this problem.
code is working but when you refresh the page i get this error "Uncaught InvalidArgumentException: invalid json token"; The token change everytime when new login
That was a great tutorial thank you. However I keep getting error about count() method needs an array as parameter and it is in regard to this line: "$token = $client->fetchAccessTokenWithAuthCode($_GET['code']);" Would you be able to help me with this?
Thank you very much! It was a very useful tutorial. I was finally able to make Google Sign in to my website. I have a question sir. As I am new to PHP I did not how to make Google sign in on my hosted website. Iuploaded Google API library to my webserver and made Google sign in. It was difficult to do it, since it took long time to upload 30MB file to the server. In web development in commercial websites, when making Google sign in, do you also upload large file to server? Or it is done by other ways? I will be genuinely glad, if you answer me! Thank you!
Deployment can be done in several ways, but in all of them you'll require google library set up in your project in the server. Whether you install it directly in the server or upload it from your local machine. Both are correct. And it should not take a long time to upload 30MB of files to the server.
You'd just have a button like the login "a" tag he made. Since logging in sets the "code" entry in GET, you can easily manipulate that by removing it from the current URL. Is the "if (isset...)" section, you'd do something like: echo "Log Out"; Since the redirectURL is just the original one without the GET part, this should easily log you out. However, it's important to note: If you stored this information using something like POST or COOKIES (cookies being an insecure method), you also need to remove those as well. That would go under the "else" section. For example, if you stored the data in POST, you'd have the line: $_POST = array();
hi sir, i got this warning i dont know what to do can you help me please Warning: require_once(C:\xampp\php\pear): Failed to open stream: Permission denied in C:\xampp\htdocs\vue\login.php on line 2 Fatal error: Uncaught Error: Failed opening required '' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\vue\login.php:2 Stack trace: #0 {main} thrown in C:\xampp\htdocs\vue\login.php on line 2
Perfect!!!! Thank you so much... Just an update : in your line 29 we need to change it to " $gauth=new Google\Service\Oauth2($client);" that is how it wotks nowadays.
ay man this was super helpful any beginner could've followed along, other tutorials say that it's for beginners and assumes that you have composer but this is something else, cheers 🥂
You're welcome! glad it helped!
Thank you. Congratulations from Brazil. I was trying with videos in my language and only now I get.
Wow its really work. Thank you sir, you are very funny. 😂
Fatal error: Uncaught Error: Class 'Google\Auth\OAuth2' not found
awesome tutorial! subscribed.
Thank you!👏
Glad it helped!
thank you so much for this tutorial, it's very useful.
why did I get this error :
Authorization Error
Error 400: invalid_request
Invalid parameter value for approval_prompt: 'auto'' is not valid
after clicking the 'login with Google' button?
someone assit am getting saying must be type countable, please assit what might be the problem
How do you solve the 403:Disallowed_useragent for iOS users? I'm using php
Very thorough and to the point - thanks! I also appreciate the bugs you ran into - that's realistic coding! Thanks again for the great vid!
Glad it helped you!
how to connect this sir into my website?
hello, do you have an idea how resolve the error 500 ? i have this same error in localhost and production. before it s work now no . i search everywhere, it's annoying this problem.
Failed to load resource: the server responded with a status of 500 ()
What is new Google_Service_0auth? Is it self-defined? Or provided by google?
code is working but when you refresh the page i get this error "Uncaught InvalidArgumentException: invalid json token"; The token change everytime when new login
same here .
Hello sir can i use header to redirect users into my home page?
That was a great tutorial thank you. However I keep getting error about count() method needs an array as parameter and it is in regard to this line: "$token = $client->fetchAccessTokenWithAuthCode($_GET['code']);" Would you be able to help me with this?
someone help with this error
update the composer
You are probably running a too old version of PHP
Hello sir , i can’t find Google_Client()
Can you help me
Thank you very much! It was a very useful tutorial. I was finally able to make Google Sign in to my website. I have a question sir. As I am new to PHP I did not how to make Google sign in on my hosted website. Iuploaded Google API library to my webserver and made Google sign in. It was difficult to do it, since it took long time to upload 30MB file to the server. In web development in commercial websites, when making Google sign in, do you also upload large file to server? Or it is done by other ways? I will be genuinely glad, if you answer me! Thank you!
Deployment can be done in several ways, but in all of them you'll require google library set up in your project in the server. Whether you install it directly in the server or upload it from your local machine. Both are correct. And it should not take a long time to upload 30MB of files to the server.
@@TheCodeCity Thank you so much!I appreciate your response!
I appreciate it bro
Hi iam using online host for my website
How can i do it ?
In redirect URL try adding the domain name of your website.
could you share how to do it in cpanel shared hosting, please? also step by step like this, thank you.
You just do it in your local machine, and upload the project to server. Nothing else is required.
@@TheCodeCity thank you mate, so clear. it worked.
Thank you
Sir can i save to my database
Yes, you can
@@TheCodeCity thanks sir, is this secure 100%
Is it process same for Facebook login too? Sorry if my question is stupid. I'm just beginning.
Yes, the question indeed is stupid. No, it's a different process for Facebook
@@TheCodeCity can you make a tutorial?
You got it!
this is amazingg...thanks
You're welcome!
a tip: you can watch series at flixzone. Me and my gf have been using it for watching all kinds of movies recently.
@Jackson Cayson Yea, I've been using flixzone} for since december myself :)
Getting ''403 Forbidden' error after login
Same. Did you find a solution?
can you tell me how to logout ???
You can do: $google_client->revokeToken(); and destroy session and handle accordingly
can u include logout
You'd just have a button like the login "a" tag he made. Since logging in sets the "code" entry in GET, you can easily manipulate that by removing it from the current URL. Is the "if (isset...)" section, you'd do something like:
echo "Log Out";
Since the redirectURL is just the original one without the GET part, this should easily log you out.
However, it's important to note: If you stored this information using something like POST or COOKIES (cookies being an insecure method), you also need to remove those as well. That would go under the "else" section. For example, if you stored the data in POST, you'd have the line:
$_POST = array();
so how to log out?
Source Code pls :
Error: Class 'Google_Client' not found
@@boizdeeptry Did you set up the Google SDK properly, sorry unfortunately the source code is not available at the moment.
hi sir, i got this warning i dont know what to do can you help me please
Warning: require_once(C:\xampp\php\pear): Failed to open stream: Permission denied in C:\xampp\htdocs\vue\login.php on line 2
Fatal error: Uncaught Error: Failed opening required '' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\vue\login.php:2 Stack trace: #0 {main} thrown in C:\xampp\htdocs\vue\login.php on line 2