Source:
<code>public static void main(String... args) throws IOException, InterruptedException, ExecutionException { final String clientId = "your client id"; final String clientSecret = "your client secret"; final OAuth20Service service = new ServiceBuilder(clientId) .apiSecret(clientSecret) .defaultScope("read_all") .callback("http://localhost/callback") .build(StravaApi.instance()); final Scanner in = new Scanner(System.in); System.out.println("=== " + NETWORK_NAME + "'s OAuth Workflow ==="); System.out.println(); System.out.println("Fetching the Authorization URL..."); final String secretState = "secret" + new Random().nextInt(999_999); final String authorizationUrl = service.getAuthorizationUrl(secretState); System.out.println("Got the Authorization URL!"); System.out.println("Now go and authorize ScribeJava here:"); System.out.println(authorizationUrl); System.out.println("And paste the authorization code here"); System.out.print(">>"); final String code = in.nextLine(); System.out.println(); System.out.println("Trading the Authorization Code for an Access Token..."); final OAuth2AccessToken accessToken = service.getAccessToken(code); System.out.println("Got the Access Token!"); System.out.println("(The raw response looks like this: " + accessToken.getRawResponse() + "')"); <START> System.out.println(); <END> }</code><technical_language>show API call this access_token</technical_language>

Target:
public static void main(String... args) throws IOException, InterruptedException, ExecutionException { final String clientId = "your client id"; final String clientSecret = "your client secret"; final OAuth20Service service = new ServiceBuilder(clientId) .apiSecret(clientSecret) .defaultScope("read_all") .callback("http://localhost/callback") .build(StravaApi.instance()); final Scanner in = new Scanner(System.in); System.out.println("=== " + NETWORK_NAME + "'s OAuth Workflow ==="); System.out.println(); System.out.println("Fetching the Authorization URL..."); final String secretState = "secret" + new Random().nextInt(999_999); final String authorizationUrl = service.getAuthorizationUrl(secretState); System.out.println("Got the Authorization URL!"); System.out.println("Now go and authorize ScribeJava here:"); System.out.println(authorizationUrl); System.out.println("And paste the authorization code here"); System.out.print(">>"); final String code = in.nextLine(); System.out.println(); System.out.println("Trading the Authorization Code for an Access Token..."); final OAuth2AccessToken accessToken = service.getAccessToken(code); System.out.println("Got the Access Token!"); System.out.println("(The raw response looks like this: " + accessToken.getRawResponse() + "')"); System.out.println(); System.out.println("Now we're going to access a protected resource..."); final OAuthRequest request = new OAuthRequest(Verb.GET, ATHLETE_INFO); service.signRequest(accessToken, request); try (Response response = service.execute(request)) { System.out.println("Got it! Lets see what we found..."); System.out.println(); System.out.println(response.getCode()); System.out.println(response.getBody()); } System.out.println(); System.out.println("That's it man! Go and build something awesome with ScribeJava! :)"); }