Reputation: 2910
I have authenticated a youtube user using oauth( zend gdata library used).
$url = Zend_Gdata_AuthSub::getAuthSubTokenUri($returnUrl, $this->scope, $this->isSecure, $this->isSession);
$httpClient = Zend_Gdata_AuthSub::getHttpClient(Yii::app()->user->sessionToken);
How to retrieve the user profile information (I need his/her username)? From zend gdata documentation I have found this code :
$yt = new Zend_Gdata_YouTube();
$userProfile = $yt->getUserProfile('liz');
But, using oauth authentication, I couldn't retrieve the username.
Upvotes: 1
Views: 434
Reputation: 546
I just had the same problem, found the solution buried amongst these responses
$yt->getUserProfile("default")->username->text;
This will get you the username of the currently authenticated user
Upvotes: 1