Tsugi

GoogleLogin
in package

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.

Table of Contents

Properties

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

Methods

__construct()  : mixed
curl_get()  : mixed
Utility code in order not to have external dependencies and to have some logging.
curl_post()  : mixed
Utility code in order not to have external dependencies and to have some logging.
getAccessToken()  : mixed
Get the access token
getLoginUrl()  : mixed
Get the login url
getUserInfo()  : mixed

Properties

$authentication_object

public mixed $authentication_object = false

Methods

__construct()

public __construct(mixed $client_id, mixed $client_secret, mixed $redirect[, mixed $openid_realm = false ]) : mixed
Parameters
$client_id : mixed
$client_secret : mixed
$redirect : mixed
$openid_realm : mixed = false

curl_get()

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

public curl_get(mixed $url) : mixed
Parameters
$url : mixed

curl_post()

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

public curl_post(mixed $url, mixed $post) : mixed
Parameters
$url : mixed
$post : mixed

getAccessToken()

Get the access token

public getAccessToken(mixed $google_code) : mixed
Parameters
$google_code : mixed

getLoginUrl()

Get the login url

public getLoginUrl(mixed $state) : mixed
Parameters
$state : mixed

getUserInfo()

public getUserInfo([mixed $access_token = false ]) : mixed
Parameters
$access_token : mixed = false

        
On this page

Search results