Skip to main content

Usage

Prerequisites

GitLab Setup

After installing the OAuth extension, you can now enable GitLab Login for your Magic app:
  1. Go to your Magic Dashboard
  2. Select the Magic app for which you’d like to enable GitLab Login, or create a new app
  3. Navigate to Social Login from the sidebar
  4. Click the toggle for GitLab
  5. Go to GitLab App Dashboard
  6. On the left sidebar, select your avatar
  7. Select Edit Profile
  8. On the left sidebar, select Applications
  9. Select Add new application
  10. In the application form, enter a Name (arbitrary), and add your Redirect URI: Add the Redirect URI you are passing as the redirectURI argument to the loginWithRedirect method:
    JavaScript
    await magic.oauth2.loginWithRedirect({
      provider: 'gitlab',
      redirectURI: 'https://your-app.com/your/oauth/callback', // whitelist this with GitLab
    });
    
  11. Make sure to tick openid, profile, email in the Scopes
GitLab application form showing openid, profile, and email scope checkboxes
  1. Click Save application to save your GitLab app
  2. You will be provided with the Application ID and Secret
  3. Return to your Magic Dashboard and input the Application ID and Secret for your GitLab OAuth app
  4. In Magic Dashboard, click Save

Resources