Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Login with Google Plus on My Website

I'm very new to web development. I have searched for login with Google plus and found several good tutorials. But they seems to be very old (most of them from 2011). Why?

I tried below code chunks.

<script type="text/javascript" language="javascript">    
   $("#packagesGrid").load('https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=ya29.ahes6zt9yv2qaeej5ycn21fn9maokp15scwqkcal3guqxxez7odtjg&token_type=bearer&expires_in=3600');    
</script>

I just manually copy pasted the token to the url on the jQuery load function. But nothing is filled to the page.

like image 792
Kasun Rajapaksha Avatar asked Sep 24 '12 05:09

Kasun Rajapaksha


People also ask

How do I access Google +?

A new version of the Google+ Android app was released on February 21, 2019. All Android users will need to update to this Google+ Android app immediately to continue using the app. Old versions of the app will no longer be supported. Users can still use Google+ on their mobile web browser at plus.google.com.

Is login with Google free?

Google Sign-in is a free service.


4 Answers

Google APIs use the OAuth 2.0 protocol for authentication and authorization. Google supports several OAuth 2.0 flows that cover common web server, JavaScript, device, installed application, and server to server scenarios. The Previous Versions of OAuth has been deprecated by Google.

Here is how it works : https://developers.google.com/accounts/docs/OAuth2

To Get Started with Coding,

https://code.google.com/p/google-plus-php-starter/

Just download the project and Follow the steps mentioned.

I have tried this recently and it's working 100% fine.

like image 139
Vijay Sarin Avatar answered Oct 23 '22 07:10

Vijay Sarin


I'm in a Google presentation at the moment and apparently they have just launched Google+ sign-in, which allows you to do stuff like this much more elegantly.

I don't know any more about it than that, really, but it certainly seems worth a look.

like image 27
Owen Blacker Avatar answered Oct 23 '22 08:10

Owen Blacker


I would suggest making use of the following tutorial Login with Google Account OAuth. It explains calling the correct methods and saves the user data to your database. Plus it was published today.

like image 3
Conrad Lotz Avatar answered Oct 23 '22 09:10

Conrad Lotz


For this you have to use google client Api library for php

and after that, you need to generate some key (like client id, client secret key, simple API key for Google)

then you have to use these API and use the keys generated. You can find the complete procedure and documents at there corresponding websites...

If you neeed the working tutorial.

like image 1
rohan Avatar answered Oct 23 '22 09:10

rohan