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...
- Sign in to GitLab.
- On the top bar, in the upper-right corner, select your avatar.
- Select Edit profile.
- On the left sidebar, select Applications.
- Enter a Name and your Firebase URL as Redirect URI. Select OAuth 2 Scopes
openid
,profile
andemail
. - Select Save application. GitLab provides:
- The Client ID in the Application ID field
- The Client Secret
- Go to the Identity Platform page in the Google Cloud console and create a new provider (OpenID Connect). Paste Client ID and Client Secret.
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: