Integration with frontend adminstration


#1

I’m creating an integration but I want to also have site where users can login (users from the integration or new users and have them install the integration). On this site they could see on which repo’s the integration is activated but also some stuff like billinng, etc…But how should I implement this?

Workflow could be like this:

Users goes to the integration install page on github -> installs the integration

From there on it could go 2 ways:

  • User goes to my site and registers/logins (don’t know how for now)
  • User stays on github but logs in on a later moment on my site

So few questions on how to do this.

  • What would be the advised workflow for this?
  • How can I know if a user logs in with oauth to which installation he is related

#2

It sounds like what you’re looking for is a GitHub App that also has OAuth to authorize individual users within the scope of the application.

This is currently possible. When you create a GitHub App you’re also given oauth credentials that you can use in your application (at the bottom of the “general” tab of the app settings).

So the workflow would be:

  1. They install the app on their organization or account
  2. They go to your site and authorize as themselves so that the integration can make requests on their behalf

How can I know if a user logs in with oauth to which installation he is related

Once a user is authorized in the app, you can make a request to https://developer.github.com/v3/apps/#list-installations-for-user to find out which installations they have access to.

You can read more about that here:
https://developer.github.com/apps/building-integrations/setting-up-and-registering-github-apps/identifying-users-for-github-apps/#check-which-installations-resources-a-user-can-access