GitLab.com OAuth2 authentication
Import projects from GitLab.com and login to your GitLab instance with your GitLab.com account.
Set up GitLab.com
To enable the GitLab.com OmniAuth provider, you must register your GDK instance with your GitLab.com account. GitLab.com generates an application ID and secret key for you to use.
Sign in to GitLab.com.
On the upper right corner, click on your avatar and go to your Settings.
Select Applications in the left menu.
Provide the required details for Add new application:
Name: This can be anything. Consider something descriptive such as “Local GitLab.com OAuth”.
Redirect URI: Make sure this matches what you have set for your localhost (for example,
gdk.test:3000
):http://gdk.test:3000/import/gitlab/callback http://gdk.test:3000/users/auth/gitlab/callback
The first link is required for the importer and second for the authorization.
Select Save application.
You should now see an Application ID and Secret. Keep this page open as you continue configuration.
Set up GDK
Within GDK, open
gitlab/config/gitlab.yml
.Look for the following:
development: <<: *base omniauth: providers:
Under
providers
, indent and add:- { name: 'gitlab', app_id: 'YOUR_APP_ID', app_secret: 'YOUR_APP_SECRET', args: { scope: 'api' } }
Update
YOUR_APP_ID
andYOUR_APP_SECRET
with values that were generated in the previous step.Run
gdk restart
.
You should now be able to import projects from GitLab.com, as well as sign in to your instance with a GitLab.com account.
Note
Running gdk reconfigure
removes your provider and you need to re-add it.