2013-04-18 32 views
2

我正在面对一个与youtube java证书有关的问题,通常它运行良好,我可以上传到youtube,但是今天我得到这个异常无效凭证。Java Youtube凭据?

YouTubeService service = new YouTubeService("id", developer_key); 

try { 
    service.setUserCredentials(login, "pass); 
} catch (AuthenticationException e1) { 
    // TODO Auto-generated catch block 
    e1.printStackTrace(); 
}  

堆栈跟踪:

> 

com.google.gdata.client.GoogleService$InvalidCredentialsException: Invalid credentials 11:23:07,915 ERROR [STDERR] 
at com.google.gdata.client.GoogleAuthTokenFactory.getAuthException(GoogleAuthTokenF‌​actory.java:660) 11:23:07,915 ERROR [STDERR] 
at com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken(GoogleAuthTokenFacto‌​ry.java:560) 11:23:07,915 ERROR [STDERR] 
at com.google.gdata.client.GoogleAuthTokenFactory.setUserCredentials(GoogleAuthToke‌​nFactory.java:397) 
+0

我没有修改代码,我仍然使用相同的一个。这里是错误我com.google.gdata.client.GoogleService $ InvalidCredentialsException:无效的凭据 11:23:07,915错误[STDERR] \t at com.google.gdata.client.GoogleAuthTokenFactory.getAuthException(GoogleAuthTokenFactory.java:660) 11:23:07,915错误[STDERR] \t at com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken(GoogleAuthTokenFactory.java:560) 11:23:07,915错误[STDERR] \t at com.google.gdata.client。 GoogleAuthTokenFactory.setUserCredentials(GoogleAuthTokenFactory.java:397) – user2294389

+0

我遇到同样的问题。他们必须改变服务器上的某些东西。不确定是什么问题。他们可能已禁用ClientLogin? – kungfoo

+0

快速更新。我的一个帐户(登台)已开始工作,但另一个帐户仍然返回BadAuthentication。我认为问题正在慢慢解决。 – kungfoo

回答

0

我还没有Youtube credentials工作,但由于这是Java代码,所以我只是从我看到的净例子猜测..

尝试

service.setUserCredentials(login, pass); //remove quotes 

代替:

service.setUserCredentials(login, "pass); 
+0

这不是这个问题,因为我只是不想把我的登录和我的通行证放在软件上,我忘记删除报价 – user2294389