GT
gtss/OAuthClient_Java
his is a Java example for an OAuth2 client connecting to TrainingPeaks OAuth server.
This is your TrainingPeaks OAuth client example
This is a Java example for an OAuth2 client connecting to TrainingPeaks OAuth server.
TO GET UP AND RUNNING WITH THIS CLIENT:
- Install the Play2.0 framework. Here is the Play2.0 walkthough: http://www.playframework.com/documentation/2.1.0/JavaTodoList
- Download these files under the "play" directory. It should be at the same location as play-2.1.0 after the installation.
- Open a command prompt and navigate to the directory where you downloaded these files.
- At the prompt: C:\Users\me\Peaksware\Sandbox\play\TPOAuthClient_Java> play
- If you want to set this up for editing in IntelliJ, run at the prompt: [TPOAuthClient_Java] $ idea.
- Other IDEs can also be set up. See here: http://www.playframework.com/documentation/2.1.0/IDE
- At the prompt: [TPOAuthClient_Java] $ run
- Open a browser to http://localhost:9000
- The client is configured to negotiate with our UAT server and callback to localhost:9000/callback which is a valid route in this example
THE EXAMPLE CODE IS IN THESE FILES:
/app/controllers/Application.java
/app/src/OAuth2ClientCredentials.java
/app/src/ResourceUrl.java
THE CONFIGS ARE IN THIS FILE:
/conf/application.conf
** All importane config settings are at the bottom of the config file **
On this page
Created September 3, 2013
Updated November 10, 2016