0

While implementing the Facebook Connect to a web application , its possible to show Facebook Sign up page in a pop up and once logging in and Granting permissions are complete, its possible to Authenticate Again in PHP and to get the necessary details of the user, - id, email etc.

I believe, thats secure because, the User Insertion is not based on the Ajax Request Parameters.

Is it possible to do the same with Google Plus Login also ?

Means - Logging in to Google - Using Javascript SDK, asking permissions, Authenticating all done in a Pop Up Window. and then, Creating a new user with the Help of google-api-php-client ??

1

1 Answer 1

2

Yes, what you're trying to do is outlined with https://developers.google.com/+/web/signin/server-side-flow which includes some PHP code samples to help you do this. In general, the steps at authentication time are:

  1. User clicks the "Sign in with Google" button which may pop-up a new window at Google prompting them to log in and authorize your webapp.
  2. After they do so, a one-time code is sent to a JavaScript callback you specify.
  3. Your Javascript method sends this code to your PHP server.
  4. Your PHP server uses the client library to contact Google's server and exchange this one-time code for an access token and refresh token, which you keep and use to perform actions on the user's behalf.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.