Replies: 1 comment
-
For anybody struggling with this, take a look at the installation method on Octocrab. For example: let octocrab = Octocrab::builder().app(app_id, key).build()?;
let installations = octocrab
.apps()
.installations()
.send()
.await
.unwrap()
.take_items();
let install = installations
.iter()
.find(|&i| i.account.login == "your-user-or-org")
.unwrap();
octocrab.installation(install.id);
// Use `octocrab` as normal to make an API request ... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have registered a github app and would like users to be able to authenticate to the app via Github OAuth. I can't see a clear example of how to do this, doc comments and example seem to say different things.
My env vars are set.
Here is a handler I'm using for testing
If I remove the
list_repos_for_authenticated_user()
call, I get a 200. Currently the.map_err()
closure is being executed with a 500 error.This is the flow I am trying to do: https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authenticating-to-the-rest-api-with-an-oauth-app
Github is successfully calling the callback URL which calls that handler function I've provided. Should I be using different octocrab builder args?
Beta Was this translation helpful? Give feedback.
All reactions