Skip to content

Instantly share code, notes, and snippets.

@mach-kernel
Last active August 29, 2015 14:23
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 mach-kernel/5e00c822bb7a30e6b2bc to your computer and use it in GitHub Desktop.
Save mach-kernel/5e00c822bb7a30e6b2bc to your computer and use it in GitHub Desktop.
it works!
OAuthServiceSync o = createOAuthService();
TokenResponse t = o.getToken(new DwollaTypedBytes(new Gson(),
new TokenRequest("client_id",
"client_secret", "authorization_code",
"redirect", "code")));
System.out.println("token: " + t.access_token);
System.out.println("refresh token: " + t.refresh_token);
TokenResponse r = o.refreshToken(new DwollaTypedBytes(new Gson(),
new TokenRequest("id",
"secret", "refresh_token", t.refresh_token)));
System.out.println("refreshed result: " + r.access_token);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment