Skip to content

Instantly share code, notes, and snippets.

@skiph
Created October 24, 2017 07:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skiph/0c5caab71a64728a846f2260ddafcc67 to your computer and use it in GitHub Desktop.
Save skiph/0c5caab71a64728a846f2260ddafcc67 to your computer and use it in GitHub Desktop.
private void startCodeExchange() {
Log.i(TAG, "Starting code exchange");
loginListener.onEvent(AuthRepo.this, AUTH_CODE_EXCHANGE_START);
AuthorizationResponse resp = authState.getLastAuthorizationResponse();
authService.performTokenRequest(
resp.createTokenExchangeRequest(), this::onTokenRequestCompleted);
}
private void onTokenRequestCompleted(TokenResponse resp, AuthorizationException ex) {
if (resp == null) {
failLogin(new AuthException(ex.getMessage()));
return;
}
authState.update(resp, ex);
finishCodeExchange();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment