【发布时间】:2013-09-05 13:07:54
【问题描述】:
我正在使用Google api php client 来验证从 android 应用发送的 idToken。我是这样验证的:
$client = new Google_Client();
if (isset($token)) {
$client->setClientId("xxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com");
try{
$userId = $client->verifyIdToken($token)->getUserId();
}catch(Exception $e){
...
Google_Client 类调用然后Google_OAuth2 类,其中验证实际上在方法verifySignedJwtWithCerts 中完成。
我不仅想获取 userId,还想获取令牌的过期时间戳。我虽然我可能会在 Google_OAuth2 中创建一个方法来获取它,然后在 Google_client 中调用 Google_Oauth2 中的第一个方法,但它没有用。怎么可能做到?
【问题讨论】:
标签: php oauth-2.0 token google-oauth google-client