Máy chủ nhận được one-time authorization code từ ứng dụng dành cho thiết bị di động. Tôi cần phải chuyển đổi nó thành mã thông báo truy cập mạng xã hội và mã thông báo làm mới và lưu chúng trên máy chủ DB để sử dụng sau này.Spring Social Google - chuyển đổi mã ủy quyền một lần thành mã thông báo truy cập/làm mới truy cập trên máy chủ
mã hiện tại của tôi:
String oneTimeAuthorizationCode= "xxx"; // provided by mobile client
ConnectionData cd = new ConnectionData("google", null, null, null, null, oneTimeAuthorizationCode, null, null, null);
GoogleConnectionFactory googleConnectionFactory = (GoogleConnectionFactory) connectionFactoryLocator.getConnectionFactory("google");
Connection<Google> connection = googleConnectionFactory.createConnection(cd);
// get the google API and work with it
Google google = (Google) connection.getApi();
oneTimeAuthorizationCode là sai vì ConnectionData được mong đợi một access token và không phải là mã ủy quyền một thời gian. Bất kỳ ý tưởng làm thế nào để có được spring-social-google để trao đổi mã một lần cho mã thông báo truy cập và mã thông báo làm mới?