class GoogleLogin

A very simple Google Login

This is a simple wrapper class to hold some Google Login functionalty. I wrapped this in a class to avoid namespace conflicts with the common function names in this code.

It is based on this blog post:

http://www.nmecs.com/articles/google-single-sign-on-without-sdk

See docs/LOGIN.md in the tsugi repo for details on how to set this up with Tsugi.

Properties

$client_id
$client_secret
$openid_realm
$redirect
$access_token
$last_response
$authentication_object

Methods

__construct($client_id, $client_secret, $redirect, $openid_realm = false)

No description

getLoginUrl($state)

Get the login url

getAccessToken($google_code)

Get the access token

getUserInfo($access_token = FALSE)

No description

curl_post($url, $post)

Utility code in order not to have external dependencies and to have some logging.

curl_get($url)

Utility code in order not to have external dependencies and to have some logging.

Details

at line 29
__construct($client_id, $client_secret, $redirect, $openid_realm = false)

Parameters

$client_id
$client_secret
$redirect
$openid_realm

at line 39
getLoginUrl($state)

Get the login url

Parameters

$state

at line 57
getAccessToken($google_code)

Get the access token

Parameters

$google_code

at line 102
getUserInfo($access_token = FALSE)

Parameters

$access_token

at line 145
curl_post($url, $post)

Utility code in order not to have external dependencies and to have some logging.

Parameters

$url
$post

at line 163
curl_get($url)

Utility code in order not to have external dependencies and to have some logging.

Parameters

$url