GoogleLoginService
in package
Google site login: OAuth callback, then the google.com user, site course, and session.
Table of Contents
Methods
- authorizeUrl() : string
- Google OAuth authorize URL for the sign-in button.
- establishSiteSession() : GoogleLoginResult
- Upsert profile/user under the google.com key and fill the site-login session.
- processCallback() : GoogleLoginResult
- Handle a visit to the login page: either the Google button URL, or a completed OAuth callback.
- resetSessionToEmpty() : mixed
- Remove every key in the current PHP session.
Methods
authorizeUrl()
Google OAuth authorize URL for the sign-in button.
public
static authorizeUrl(string $callback_url) : string
Parameters
- $callback_url : string
-
The URL Google should redirect back to
Return values
stringestablishSiteSession()
Upsert profile/user under the google.com key and fill the site-login session.
public
static establishSiteSession(string $user_key, string $userEmail, string $displayName[, string|false $userAvatar = false ][, callable|null $redirect_callback = null ][, array<string|int, mixed> $options = array() ]) : GoogleLoginResult
Parameters
- $user_key : string
- $userEmail : string
- $displayName : string
- $userAvatar : string|false = false
- $redirect_callback : callable|null = null
- $options : array<string|int, mixed> = array()
-
create_courses (0/1 or omit), force_membership_role (upsert learner)
Return values
GoogleLoginResultprocessCallback()
Handle a visit to the login page: either the Google button URL, or a completed OAuth callback.
public
static processCallback(string $callback_url[, callable|null $redirect_callback = null ]) : GoogleLoginResult
Parameters
- $callback_url : string
-
The URL Google should redirect back to
- $redirect_callback : callable|null = null
-
Optional callback for custom redirect logic
Return values
GoogleLoginResultresetSessionToEmpty()
Remove every key in the current PHP session.
public
static resetSessionToEmpty() : mixed