Permalink
Switch branches/tags
7-11-stable-ee 7-12-stable-ee 7-13-stable-ee 7-14-stable-ee 8-0-stable-ee 8-1-stable-ee 8-2-6-changelog-entries 8-2-stable-ee 8-3-stable-ee 8-4-stable-ee 8-5-stable-ee 8-6-stable-ee 8-7-stable-ee 8-8-stable-ee 8-9-stable-ee 8-10-stable-ee 8-11-stable-ee-to-master 8-11-stable-ee 8-12-stable-ee 8-13-stable-ee 8-14-stable-ee 672-import_url-nil 675-protected-branch-specific-groups 789-geo-clone-ui 882-deny-delete-tag-regression 886-incomplete-information-setting-up-pages-domain 939-repositoryupdatemirrorworker-updatemirrorerror-rugged-invaliderror-cannot-set-empty-url 1165-jej-remote-mirror-validation-failures 1184-do-not-email-blocked-users 1251-clarify-elasticsearch 1289-merge-request-serializer-breaks 12726-preserve-issues-after-deleting-users-ee 15343-build-settiings 21983-member-add_user-doesn-t-detect-existing-members-that-have-requested-access-ee 22253-move-lfshelper-methods-somewhere-else-than-app-helpers-ee 22719-provide-a-new-gitlab-workhorse-install-rake-task-similar-to-gitlab-shell-install-ee 23100-slow-query-number-of-potential-approvers 23945-improve-ee_compat_check-task-part-3-ee 24669-merge-request-dashboard-page-takes-over-a-minute-to-load-ee 25011-hoverstates-for-collapsed-issue-merge-request-sidebar-EE adding_missing_info_to_ldapee approver-ui ce-8-5-stable-to-ee-8-5-stable-ee ce-5824-ee-581-backport-changes ce-21170-cycle-analytics ce-stable-upstream ce-to-ee-merge-check-rake-task-ee ce_issue_18759 disable-prev-next-8.8.3-ee doc/sentinel-ee docs/geo-improvements docs/git-filter-branch ee-870-backport-ee ee-1137-follow-up-protected-branch-users-and-groups-ee ee-new-diff-notes elasticsearch_ es_add_explamnation_comments es_search_through_filenames expose-add-ons-in-license-api fe-multiple-issue-boards fe-time-tracking feature/cycle-analytics-events-ee-tmp file_lock fix-8-12-stable-ee fix-broken-spec fix-ee-master fix-ldap-group-sync fix-more-orphans-remove-undeleted-groups-ee fix-protected-branch fix/ce-14503 fix_change_access fix/es-instrumentation fix/remote-mirror-url fix_remove_source_branch fix_rubocop_complains fix_slack_notification_build fix/user-activities-config fix/396 gitlab-pages grapify-projects-api-ee group-sync-update-perms group_approvers_ issue-weight-range issue_385 issue_587 issue_828-ee issue_1008_1-ee issue_22944-ee kerberos-ssh-lfs-test knapsack-ee master max-file-size-git-hook mrchrisw/admin-sync mrchrisw/ldap-docs mrchrisw/ldap-snip-apostrophe mrchrisw/ldap-timeout mrchrisw/ldap-unicode-docs mrchrisw/sync-times patch/load_average prevent-committing-secrets-ui-first-iteration project-settings-tooltips rc-improve-members-destroy-service-ee refactor-appearance refactor-issuable-title-form-ee remove_annotate require-ee-ldap-properly revert-9b9a31c7 rs-issue-99 settings_getter_fix sh-812-stable-ee-test sh-test-8-9-stable-ee show_hide_credentials sidebar-updates sidekiq-cluster stable-fixes test_search test time-tracking-backend timetracking-1.1 update-changelog-8-8-5-ee update-for-ee-stable use-current-active-users-for-license use-xml-lexer-for-svg-files use_redis_pool_for_geo user-activity-front-end users_select_tag_helper verbose_git_hooks
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
111 lines (76 sloc) 3.43 KB

Integrate your server with GitHub

Import projects from GitHub and login to your GitLab instance with your GitHub account.

To enable the GitHub OmniAuth provider you must register your application with GitHub. GitHub will generate an application ID and secret key for you to use.

  1. Sign in to GitHub.

  2. Navigate to your individual user settings or an organization's settings, depending on how you want the application registered. It does not matter if the application is registered as an individual or an organization - that is entirely up to you.

  3. Select "OAuth applications" in the left menu.

  4. If you already have applications listed, switch to the "Developer applications" tab.

  5. Select "Register new application".

  6. Provide the required details.

    • Application name: This can be anything. Consider something like <Organization>'s GitLab or <Your Name>'s GitLab or something else descriptive.
    • Homepage URL: The URL to your GitLab installation. 'https://gitlab.company.com'
    • Application description: Fill this in if you wish.
    • Authorization callback URL is 'http(s)://${YOUR_DOMAIN}'
  7. Select "Register application".

  8. You should now see a Client ID and Client Secret near the top right of the page (see screenshot). Keep this page open as you continue configuration. GitHub app

  9. On your GitLab server, open the configuration file.

    For omnibus package:

      sudo editor /etc/gitlab/gitlab.rb

    For installations from source:

      cd /home/git/gitlab
    
      sudo -u git -H editor config/gitlab.yml
  10. See Initial OmniAuth Configuration for initial settings.

  11. Add the provider configuration:

    For omnibus package:

    For GitHub.com:

      gitlab_rails['omniauth_providers'] = [
        {
          "name" => "github",
          "app_id" => "YOUR_APP_ID",
          "app_secret" => "YOUR_APP_SECRET",
          "args" => { "scope" => "user:email" }
        }
      ]

    For GitHub Enterprise:

      gitlab_rails['omniauth_providers'] = [
        {
          "name" => "github",
          "app_id" => "YOUR_APP_ID",
          "app_secret" => "YOUR_APP_SECRET",
          "url" => "https://github.com/",
          "args" => { "scope" => "user:email" }
        }
      ]

    For installation from source:

    For GitHub.com:

      - { name: 'github', app_id: 'YOUR_APP_ID',
        app_secret: 'YOUR_APP_SECRET',
        args: { scope: 'user:email' } }
    

    For GitHub Enterprise:

      - { name: 'github', app_id: 'YOUR_APP_ID',
        app_secret: 'YOUR_APP_SECRET',
        url: "https://github.example.com/",
        args: { scope: 'user:email' } }
    

    Replace https://github.example.com/ with your GitHub URL.

  12. Change 'YOUR_APP_ID' to the client ID from the GitHub application page from step 7.

  13. Change 'YOUR_APP_SECRET' to the client secret from the GitHub application page from step 7.

  14. Save the configuration file and run sudo gitlab-ctl reconfigure.

  15. Restart GitLab for the changes to take effect.

On the sign in page there should now be a GitHub icon below the regular sign in form. Click the icon to begin the authentication process. GitHub will ask the user to sign in and authorize the GitLab application. If everything goes well the user will be returned to GitLab and will be signed in.