Managed secret providers
GitLab
Connect GitLab to Alter Vault for secure API access
Overview
Section titled “Overview”Use GitLab credentials to make authenticated API calls through Alter Vault without exposing API keys in code.
| Property | Value |
|---|---|
| Provider ID | gitlab |
| Category | Developer Tools |
| Credential Type | API Key |
Step 1: Get Credentials
Section titled “Step 1: Get Credentials”Log in to GitLab
Log in to GitLab at gitlab.com.
Go to User Settings → Access Tokens
Go to User Settings → Access Tokens at gitlab.com/-/user_settings/personal_access_tokens.
Add a new token
Click ‘Add new token’, set name, expiration, and scopes.
Copy your token
Copy the generated token.
Enter hostname if self-hosted
If using a self-hosted instance, enter the hostname in the GitLab Hostname field.
Step 2: Add to Alter Vault
Section titled “Step 2: Add to Alter Vault”Open the Developer Portal
Go to portal.alterauth.com and navigate to the application.
Add GitLab
Go to Managed Secrets > Add Provider > GitLab.
Enter credentials
Paste your Personal Access Token into the credential field. If using a self-hosted instance, also enter your GitLab hostname in the GitLab Hostname field.
Save
Click Save. You’ll receive a grant_id to use with the SDK.
Using in Code
Section titled “Using in Code”response = await alter_app.request( HttpMethod.GET, "https://YOUR_GITLAB_HOST/api/v4/projects", grant_id="YOUR_GRANT_ID", # Use gitlab.com for cloud or your self-hosted hostname)