Skip to content
Migrating from NextAuth.js v4? Read our migration guide.
API reference
gitlab

providers/gitlab

Built-in GitLab integration.

GitLabProfile

Extends

  • Record<string, any>

Properties

avatar_url

avatar_url: string;

bio

bio: string;

bot

bot: boolean;

can_create_group

can_create_group: boolean;

can_create_project

can_create_project: boolean;

color_scheme_id

color_scheme_id: number;

commit_email

commit_email: string;

confirmed_at

confirmed_at: string;

created_at

created_at: string;

current_sign_in_at

current_sign_in_at: string;

email

email: string;

external

external: boolean;

extra_shared_runners_minutes_limit

extra_shared_runners_minutes_limit: number;

followers

followers: number;

following

following: number;

id

id: number;

identities

identities: {
  extern_uid: string;
  provider: string;
  }[];

job_title

job_title: string;

last_activity_on

last_activity_on: string;

last_sign_in_at

last_sign_in_at: string;

linkedin

linkedin: string;

local_time

local_time: string;

location?

optional location: string;

name

name: string;

organization

organization: string;

private_profile

private_profile: boolean;

projects_limit

projects_limit: number;

pronouns

pronouns: string;

public_email

public_email: string;

shared_runners_minutes_limit

shared_runners_minutes_limit: number;

skype

skype: string;

state

state: string;

theme_id

theme_id: number;

twitter

twitter: string;

two_factor_enabled

two_factor_enabled: boolean;

username

username: string;

web_url

web_url: string;

website_url

website_url: string;

work_information?

optional work_information: string;

default()

default<P>(options): OAuthConfig<P>

Add GitLab login to your page.

Setup

Callback URL

https://example.com/api/auth/callback/gitlab

Configuration

import Auth from "@auth/core"
import GitLab from "@auth/core/providers/gitlab"
 
const request = new Request(origin)
const response = await Auth(request, {
  providers: [GitLab({ clientId: GITLAB_CLIENT_ID, clientSecret: GITLAB_CLIENT_SECRET })],
})

Resources

Notes

By default, Auth.js assumes that the GitLab provider is based on the OAuth 2 specification.

💡

Enable the read_user option in scope if you want to save the users email address on sign up.

💡

The GitLab provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.

Disclaimer If you think you found a bug in the default configuration, you can open an issue.

Auth.js strictly adheres to the specification and it cannot take responsibility for any deviation from the spec by the provider. You can open an issue, but if the problem is non-compliance with the spec, we might not pursue a resolution. You can ask for more help in Discussions.

Type parameters

Type parameter
P extends GitLabProfile

Parameters

ParameterType
optionsOAuthUserConfig<P>

Returns

OAuthConfig<P>

Auth.js © Balázs Orbán and Team - 2024