【发布时间】:2025-12-08 16:55:02
【问题描述】:
我需要从图库中将视频上传到 YouTube,然后返回 YouTube 视频网址。但是,我一直无法成功获得授权。错误
java.lang.IllegalArgumentException:预期的数字类型,但得到了类 com.google.api.client.extensions.java6.auth.oauth2.FilePersistedCredential [key expiration_time_millis,字段私有 java.util.Map com.google.api.client .extensions.java6.auth.oauth2.FilePersistedCredentials.credentials]
发生在下面的代码行,
// 设置授权码流程。
GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
Yconstants.HTTP_TRANSPORT, Yconstants.JSON_FACTORY,
clientSecrets, scopes).setCredentialStore(credentialStore)
.build();
任何人都可以通过提供一些关于以下内容的想法来帮助我吗?
-
如何获取 JSONObject 用户的凭证字符串?
JSONObject user = new JSONObject(); user.put("access_token", ""); user.put("expiration_time_millis", 1350470676670L); user.put("refresh_token", "()"); -
如何在注册期间获取我的应用的客户端密码?
在我的 client_secret.json 中没有客户端密码值。
【问题讨论】: