Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.38 KB

gitlab.md

File metadata and controls

39 lines (28 loc) · 1.38 KB

🦊 Signing in users with GitLab

This how-to assumes you've already enabled Identity Platform, and have a basic knowledge. Please see the GitHub tutorial to learn how.

The most important steps are...

Register an application

  1. Sign in to GitLab.
  2. On the top bar, in the upper-right corner, select your avatar.
  3. Select Edit profile.
  4. On the left sidebar, select Applications.
  5. Enter a Name and your Firebase URL as Redirect URI. Select OAuth 2 Scopes openid, profile and email. Screenshot: App registration
  6. Select Save application. GitLab provides: Screenshot: Client ID and secret
    1. The Client ID in the Application ID field
    2. The Client Secret

Create OpenID Connect provider

  1. Go to the Identity Platform page in the Google Cloud console and create a new provider (OpenID Connect). Paste Client ID and Client Secret. Screenshot: OpenID Connect

JavaScript

Create an OAuthProvider instance with the provider ID you configured in the previous section. The provider ID must start with oidc.:

const provider = new firebase.auth.OAuthProvider('oidc.gitlab.com');

I have prepared an example with comments: