Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Using intallations and Github App private key authentication #308

Open
migsar opened this issue Mar 28, 2018 · 4 comments
Open

Using intallations and Github App private key authentication #308

migsar opened this issue Mar 28, 2018 · 4 comments

Comments

@migsar
Copy link

migsar commented Mar 28, 2018

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.

@pksunkara
Copy link
Owner

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

@migsar
Copy link
Author

migsar commented Mar 29, 2018

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.

@pksunkara
Copy link
Owner

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

@migsar
Copy link
Author

migsar commented Mar 31, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants