1

I am writing a java program which will create a github repo from the local files.For this I first have to authenticate and then make autenticated requests to github v3 api.

But I can't figure out how I do the authentication and get the access_token.I will be providing the username/password in java code,so I am not looking for a oAuth solution.

Can you please give some pointers or links which can help me get started.I could not find this on github developer site.Apart from authentication,It will also be helpful if you could provide a sample authenticated request to do something like create repo or pull request...

Please help.

1
  • Have a look at my answer here.It'll work for you. Commented Dec 16, 2016 at 16:53

1 Answer 1

2

You can use jcabi-github (I'm one of its developers), which does all the authentication work for you:

Github github = new RtGithub("user", "password");

Now you can create a repository:

Repo repo = github.repos().create(
  Json.createObjectBuilder().add("name", "repo-name").build()
);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.