GitLabProviderOptions class

Configuration for the GitLab OAuth provider.

Callback URL

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

Usage

import 'package:server_auth/server_auth.dart';
import 'package:server_auth/server_auth.dart';

final manager = AuthManager(
  AuthOptions(
    store: InMemoryAuthStore(),
    storeMode: AuthStoreMode.ephemeral,
    providers: [
      gitlabProvider(
        GitLabProviderOptions(
          clientId: env('GITLAB_CLIENT_ID'),
          clientSecret: env('GITLAB_CLIENT_SECRET'),
          redirectUri: 'https://example.com/auth/callback/gitlab',
        ),
      ),
    ],
  ),
);

Notes

  • For self-hosted GitLab, set baseUrl.

Constructors

GitLabProviderOptions({required String clientId, required String clientSecret, required String redirectUri, String? baseUrl, List<String> scopes = const ['read_user']})
Creates a new GitLabProviderOptions configuration.
const

Properties

baseUrl String?
Base URL for self-hosted GitLab instances.
final
clientId String
OAuth 2.0 application ID from GitLab.
final
clientSecret String
OAuth 2.0 application secret from GitLab.
final
hashCode int
The hash code for this object.
no setterinherited
redirectUri String
The URI to redirect to after authentication.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scopes List<String>
OAuth scopes to request. Defaults to ['read_user'].
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited