*
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static void main(String[] args) throws IOException {
OAuthService service = GitHubServiceFactory.newInstance().createOAuthService(CLIENT_ID, CLIENT_SECRET);
String autorizationUrl = service.getAuthorizationUrl(CALLBACK_URL);
System.out.println("Visit this url to get code and enter it.\n" + autorizationUrl);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String code = br.readLine();
String accessToken = service.getAccessToken(CALLBACK_URL, code);
System.out.println("Access Token:" + accessToken);
}