Reputation: 882
I want to perform Google's backend verification in Laravel. Sorry about the confusion.
I want to get the access-token of the user validated by Google.
Does anyone know how to do it?
Upvotes: 1
Views: 1347
Reputation: 1604
You should accept Alex Cobb's answer as it is correct. But since it is so short: Someone else had a guzzle/socialite question similar, and has an acceptable excerpt for the code: Making requests to Google API using Guzzle and Socialite in Laravel 5
And just in case you require Guzzle information: http://www.pixelite.co.nz/article/guzzle-http-post-authentication-and-form-submission-symfony-20/
which shows how guzzle is the PHP solution in making curl call.
IMPORTANT NOTE:
why reinvent the wheel, laravel does this out of the box with socialite:
Laravel Socialite Introduction
Laravel Socialite provides an expressive, fluent interface to OAuth authentication with Facebook, Twitter, Google, LinkedIn, GitHub and Bitbucket. It handles almost all of the boilerplate social authentication code you are dreading writing.
https://github.com/laravel/socialite
Upvotes: 1
Reputation: 97
You can use cURL or Guzzle and manually authenticate with the Google API.
Upvotes: 1