Google_AccessToken_Verify
extends Verify
in package
Wrapper around Google Access Tokens which provides convenience functions
Table of Contents
Constants
- FEDERATED_SIGNON_CERT_URL = 'https://www.googleapis.com/oauth2/v3/certs'
- OAUTH2_ISSUER = 'accounts.google.com'
- OAUTH2_ISSUER_HTTPS = 'https://accounts.google.com'
Properties
Methods
- __construct() : mixed
- Instantiates the class, but does not initiate the login flow, leaving it to the discretion of the caller.
- verifyIdToken() : array<string|int, mixed>
- Verifies an id token and returns the authenticated apiLoginTicket.
- getBigIntClass() : mixed
- getCache() : mixed
- getFederatedSignOnCerts() : mixed
- getJwtService() : mixed
- getOpenSslConstant() : mixed
- getPublicKey() : mixed
- getRsaClass() : mixed
- retrieveCertsFromLocation() : array<string|int, mixed>
- Retrieve and cache a certificates file.
- setPhpsecConstants() : mixed
- phpseclib calls "phpinfo" by default, which requires special whitelisting in the AppEngine VM environment. This function sets constants to bypass the need for phpseclib to check phpinfo
Constants
FEDERATED_SIGNON_CERT_URL
public
mixed
FEDERATED_SIGNON_CERT_URL
= 'https://www.googleapis.com/oauth2/v3/certs'
OAUTH2_ISSUER
public
mixed
OAUTH2_ISSUER
= 'accounts.google.com'
OAUTH2_ISSUER_HTTPS
public
mixed
OAUTH2_ISSUER_HTTPS
= 'https://accounts.google.com'
Properties
$cache
private
CacheItemPoolInterface
$cache
cache class
$http
private
ClientInterface
$http
The http client
Methods
__construct()
Instantiates the class, but does not initiate the login flow, leaving it to the discretion of the caller.
public
__construct([ClientInterface $http = null ][, CacheItemPoolInterface $cache = null ][, mixed $jwt = null ]) : mixed
Parameters
- $http : ClientInterface = null
- $cache : CacheItemPoolInterface = null
- $jwt : mixed = null
verifyIdToken()
Verifies an id token and returns the authenticated apiLoginTicket.
public
verifyIdToken(string $idToken[, string $audience = null ]) : array<string|int, mixed>
Throws an exception if the id token is not valid. The audience parameter can be used to control which id tokens are accepted. By default, the id token must have been issued to this OAuth2 client.
Parameters
- $idToken : string
-
the ID token in JWT format
- $audience : string = null
-
Optional. The audience to verify against JWt "aud"
Return values
array<string|int, mixed> —the token payload, if successful
getBigIntClass()
private
getBigIntClass() : mixed
getCache()
private
getCache() : mixed
getFederatedSignOnCerts()
private
getFederatedSignOnCerts() : mixed
getJwtService()
private
getJwtService() : mixed
getOpenSslConstant()
private
getOpenSslConstant() : mixed
getPublicKey()
private
getPublicKey(mixed $cert) : mixed
Parameters
- $cert : mixed
getRsaClass()
private
getRsaClass() : mixed
retrieveCertsFromLocation()
Retrieve and cache a certificates file.
private
retrieveCertsFromLocation(mixed $url) : array<string|int, mixed>
Parameters
- $url : mixed
-
string location
Tags
Return values
array<string|int, mixed> —certificates
setPhpsecConstants()
phpseclib calls "phpinfo" by default, which requires special whitelisting in the AppEngine VM environment. This function sets constants to bypass the need for phpseclib to check phpinfo
private
setPhpsecConstants() : mixed