I am trying to use the new Youtube API V3 : https://developers.google.com/youtube/v3/ in my android app.
To login the user to youtube services, I chose the new Google Play Services : http://developer.android.com/google/play-services/index.html
Here is my code :
AccountManager manageurcomptes = AccountManager.get(ActiviteGeneral.this);
Account[] comptes = manageurcomptes
.getAccountsByType(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
String jeton;
try {
jeton = GoogleAuthUtil.getToken(ActiviteGeneral.this, comptes[0].name,
"audience:server:client_id:xxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com");
int i = 0;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (GoogleAuthException e) {
// TODO Auto-generated catch block
e.printStackTrace();
For the GoogleAuthUtil.getToken scope parameter, I followed the article from Android Developper Blog : "Verifying Back-End Calls from Android Apps" http://android-developers.blogspot.fr/2013/01/verifying-back-end-calls-from-android.html and registered my app on Google API Console.
I created a "Client ID for installed applications".
The result is a GoogleAuthException with "detailMessage" = "Unknown".
Where is the mistake ?