octonode icon indicating copy to clipboard operation
octonode copied to clipboard

Using intallations and Github App private key authentication

Open migsar opened this issue 6 years ago • 4 comments

I am trying to use octonode for developing a Github App, is there a way to use a private key for auth and the access_tokens endpoint?

I want to use the createContents method.

migsar avatar Mar 28 '18 19:03 migsar

I am sorry I don't understand your question. Can you explain more?

pksunkara avatar Mar 28 '18 21:03 pksunkara

Sure, sorry, this is my first time using your library so I hope I am not asking for something obvious. When creating a GitHub App instead of an OAuth App or using Personal access tokens Github creates a public-private key, they keep the public part and let you download the private part, then you have to use that private key file (a pem with PKCS#1 RSAPrivateKey format) and then that key is used to get a Bearer token and make a POST request to /installations/:installation_id/access_tokens to get a new token that you can use for hitting the v3 API.

I want to follow that flow in my application but I could not find a way to build a client with a private key (the pem file), I also thought about creating that Bearer token in my own code and later using it to get the access_tokens, but did not found docs about that either. Is it possible to build the client this way or what is the recommended path to follow for this kind of application? Thanks.

migsar avatar Mar 29 '18 03:03 migsar

I am sorry, nothing like that is supported. Github App is something that had been released in the last year.

pksunkara avatar Mar 30 '18 18:03 pksunkara

Ok, thanks anyway, it is a suberb library!

I'll use the other auth methods for now and try to write a custom solution for that, I would love to collaborate to this project but I don't thing I got the skills nor the time for now.

migsar avatar Mar 31 '18 22:03 migsar