in uber-core-oauth-client-adapter/src/main/java/com/uber/sdk/core/auth/OAuth2Credentials.java [251:269]
public Credential authenticate(String authorizationCode, String userId) throws AuthException {
Preconditions.checkNotNull(authorizationCode, "Authorization code must not be null");
AuthorizationCodeTokenRequest tokenRequest = authorizationCodeFlow.newTokenRequest(authorizationCode);
TokenResponse tokenResponse;
try {
tokenResponse = tokenRequest
.setRedirectUri(redirectUri)
.setScopes(scopes)
.execute();
} catch (IOException e) {
throw new AuthException("Unable to request token.", e);
}
try {
return authorizationCodeFlow.createAndStoreCredential(tokenResponse, userId);
} catch (IOException e) {
throw new AuthException("Unable to create and store credential.", e);
}
}