GitLabOAuthServiceInterface
Contract for GitLab OAuth operations. Supports both gitlab.com and self-hosted GitLab instances. Each consumer plugin provides its own redirectUri.
GitLabOAuthServiceInterface::getAuthUrl()
abstract public function getAuthUrl(string $redirectUri, ?string $state = null): stringBuild the GitLab authorization URL.
Parameters
| Name | Type | Description |
|---|---|---|
| $redirectUri | string | Callback URL specific to the consumer plugin |
| $state | (string | null) | Opaque CSRF-protection value. When given, it is appended to the URL as-is and GitLab echoes it back unmodified on the query string of the callback request. Generating, storing, and verifying it is entirely the caller's responsibility — this provider only transports it. |
GitLabOAuthServiceInterface::exchangeCode()
abstract public function exchangeCode(string $code, string $redirectUri): Milpa\OAuth\DTO\GitLabUserInfoExchange authorization code for user info.
Parameters
| Name | Type | Description |
|---|---|---|
| $code | string | Authorization code from GitLab callback |
| $redirectUri | string | Must match the one used in getAuthUrl() |
GitLabOAuthServiceInterface::getInstanceUrl()
abstract public function getInstanceUrl(): stringGet the GitLab instance base URL (e.g. https://gitlab.com or https://git.mycompany.com).