Setting webhook URL for Github App

Our code was stored in an organization account on Github, and I am a member of the account with owner authorization. I can’t use the token OAuth App page gives me in my drone server, as stated in the introduction, because that only get me my own repos, not the repos in organization account.

I think I should use Github App to get the token. But there is an extra field to filled in to setup the Github App: webhook URL. I could not find the right url settings for this. The setting page is like this:

I filled in DRONE_HOST/hook in the webhook URL field for now, but I could not login my drone server. I’ve already given read/write authorization for all the field drone could get.

The error I get when failed to login is:

 level=error msg="cannot authenticate user. GET https://api.github.com/user/emails: 404 Not Found []"

Is it possible to integrate drone with organization account on Github?

I think I may find the answer already.
To set up drone for organization account I need to register drone as a Github App, and this requires Global Webhook, which is the feature only available to Enterprise Edition.

So I could not use free version of drone on organization account of Github, is that right?

I think I should use Github App to get the token. But there is an extra field to filled in to setup the Github App: webhook URL. I could not find the right url settings for this.

It looks like you are using the wrong configuration screen in github. You should not configuration a github application. You need to instead configure a github oauth application. This is the link: Sign in to GitHub · GitHub

This is a screenshot of the correct screen:

So I could not use free version of drone on organization account of Github, is that right?

This is incorrect.

Drone works out-of-the box with github organizations. It does not require any special configuration and does not require an enterprise or paid license. Sometimes a user or organization restricts github application access [1][2] in which case you need to configure your github organization accordingly.

But in this case, it looks like you are simply using the wrong screen, and need to instead create an oauth application at Sign in to GitHub · GitHub

cannot authenticate user. GET https://api.github.com/user/emails: 404 Not Found

This error typically indicates one of the following issues:

  1. your github account does not have a verified primary email address or
  2. you changed default scopes and omitted the user:email. I recommend using the installation defaults found at http://docs.drone.io/install-for-github/

[1] Organization-approved applications | The GitHub Blog
[2] Requesting organization approval for OAuth Apps - GitHub Docs