The server receives a one-time authorization code from the mobile app. I need to convert this to a spring-social access token and refresh token and save them on the server DB for later usage.
My current code:
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 is wrong since the ConnectionData is expecting an access token and not the one time authorization code. Any idea how to get spring-social-google to exchange the one-time code for an access token and refresh token?
This is the code to exchange authorization code for access token