GoogleCredential 在 Spring Boot 中已弃用
我到处寻找已弃用的 GoogleCredential 的新实现,但在我的用例中似乎没有任何效果:
我们正在创建一个 flutter 应用程序作为客户端,并创建 Spring Boot 应用程序作为 Rest API,我们用于发送从API 的客户端 (package:google_sign_in) 通过此行从 google api 获取配置文件信息:
GoogleCredential credential = new GoogleCredential().setAccessToken(accessToken);
Oauth2 oauth2 =
new Oauth2.Builder(new NetHttpTransport(), new JacksonFactory(), credential)
.build();
Userinfo userinfo = oauth2.userinfo().get().execute();
但问题是 GoogleCredential 和 JacksonFactory 现已弃用。 谢谢你的建议。
I have looked everywhere about a new implementation of the deprecated GoogleCredential but nothing seems to work in my use case:
We are creating a flutter application as the client and Spring Boot application as the Rest API and we are used to send the access token retrieved from the client (package:google_sign_in) to the API to go throught this lines to get the profile information from google api:
GoogleCredential credential = new GoogleCredential().setAccessToken(accessToken);
Oauth2 oauth2 =
new Oauth2.Builder(new NetHttpTransport(), new JacksonFactory(), credential)
.build();
Userinfo userinfo = oauth2.userinfo().get().execute();
but the issue is that GoogleCredential and JacksonFactory are now depricated.
thank you for your advice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论