我在 app -engine 上使用 RemoteAPI 进行谷歌身份验证(使用已弃用的 ClientLogin )。我想将其更改为 Oauth2.0 。我用谷歌搜索了很多,但没有找到太多解释。任何形式的帮助将不胜感激。
public abstract class RemoteApiClient {
protected void doOperationRemotely() throws IOException {
TestProperties testProperties = TestProperties.inst();
System.out.println("--- Starting remote operation ---");
System.out.println("Going to connect to:"
+ testProperties.PROJECT_REMOTEAPI_APP_DOMAIN + ":"
+ testProperties.PROJECT_REMOTEAPI_APP_PORT);
RemoteApiOptions options = new RemoteApiOptions().server(
testProperties.PROJECT_REMOTEAPI_APP_DOMAIN,
testProperties.PROJECT_REMOTEAPI_APP_PORT).credentials(
testProperties.TEST_ADMIN_ACCOUNT,
testProperties.TEST_ADMIN_PASSWORD);
RemoteApiInstaller installer = new RemoteApiInstaller();
installer.install(options);
try {
doOperation();
} finally {
installer.uninstall();
}
System.out.println("--- Remote operation completed ---");
}
}