code: public Connection<?> completeConnection(OAuth2ConnectionFactory<?> connectionFactory, NativeWebRequest request) {
  		if (connectionFactory.supportsStateParameter()) {
  			verifyStateParameter(request);
  		}
  		
  		String code = request.getParameter("code");
  		try {
  			AccessGrant accessGrant = connectionFactory.getOAuthOperations().exchangeForAccess(code, callbackUrl(request), null);
  			return connectionFactory.createConnection(accessGrant);
  		} catch (HttpClientErrorException e) {
  			logger.warn("HttpClientErrorException while completing connection: " + e.getMessage());
  			logger.warn("      Response body: " + e.getResponseBodyAsString());
  			throw e;
  		}
  	}
docs: Complete the connection to the OAuth2 provider.
  @param connectionFactory the service provider's connection factory e.g. FacebookConnectionFactory
  @param request the current web request
  @return a new connection to the service provider