Skip to content

Instantly share code, notes, and snippets.

@mig42
Last active August 12, 2018 08:59
Show Gist options
  • Save mig42/e9e1bf68abcb8ed66644a84a4e495a6a to your computer and use it in GitHub Desktop.
Save mig42/e9e1bf68abcb8ed66644a84a4e495a6a to your computer and use it in GitHub Desktop.
How to configure gmaster Beta to login to GitLab

Gmaster doesn't currently support OAuth to login to GitLab (either at gitlab.com or hosted). Unfortunately, GitLab only allows OAuth login to access its API. This is a temporary workaround to access your GitLab account information from Gmaster until we finally implement OAuth support for GitLab!

Gmaster asking for login information

The "Personal token" field is the key here. You have two options: either use your unique Private Token from GitLab or create a Personal Access Token.

Using the Private Token

First of all, you need to have in mind that this Private Token is only useful for API operations, such as creating a new repository or listing your currently available repositories. This means that you'll need to enter your credentials later if you wish to clone one of your repos.

To find out your current Private Token, open your account information at https://gitlab.com/profile/account (replace gitlab.com/ with the appropriate value if you're using your own GitLab instance).

GitLab account information

You'll just need to copy the text under Private token and paste it in the 'Private token' textbox in Gmaster.

Using a Personal Access Token

Unlike the Private token, these tokens can be used for git operations over HTTP (clone, fetch, etc.). To create one, open your access tokens page at https://gitlab.com/profile/personal_access_tokens (replace gitlab.com/ with the appropriate value if you're using your own GitLab instance).

You'll see something like this:

GitLab personal access tokens page

Make sure you check the api box, so Gmaster can browse your repos and create new ones, and set the expiration date you see fit. Keep in mind that Gmaster won't be able to connect to GitLab or perform authenticated operations with your GitLab repos beyond that date.

When everything looks fine, click "Create personal access token". The actual token code will appear on screen. Be careful! This is the only time you'll see it: for security reasons, it can't be displayed after you leave this page.

GitLab personal access token created

Now copy the token code and paste it in the 'Private token' textbox in Gmaster.

That's it! Time to write some code!

@Kage-Yami
Copy link

Thanks for the help document - however, it looks like the personal access token setup is broken for GitLab SaaS, due to a change in the GitLab API - I get the following message returned:
API V3 is no longer supported. Use API V4 instead.

I believe I am unable to use the private token method due to having 2FA enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment