public class GithubClient extends Object
The sample shows how to obtain a valid token for using Google APIs.
Prerequisites.
You will need a valid OAuth 2.0 client registered in Github Developer
Settings > OAuth Applications at https://github.com/settings/applications.
More specifically, you will need 'Client ID', 'Client Secret', 'Authorization
callback URL' exactly as specified in the registered application.
Additionally, you will need also API scopes.
Using the sample.
To trigger a token request the sample needs a couple of parameters from your
client and apis that you will use with the token (specified above).
You can supply them as environment variables and run the java program or you
can supply them interactively in the command line. Mixing the two options is
also possible, i.e. supply part of the parameters as environment variables
and another part interactively.
The names of the environment variables that you can use to supply the
parameters are:
Reference
https://developer.github.com/apps/building-integrations/setting-up-and-registering-oauth-apps/about-authorization-options-for-oauth-apps/
| Constructor and Description |
|---|
GithubClient() |
public static void main(String[] args) throws OAuth2ProtocolException, IOException
OAuth2ProtocolExceptionIOExceptionCopyright © 2017. All rights reserved.