Configure access to private repositories
You can configure HTTP basic authentication to access private Git repositories that use HTTP or HTTPS URLs. This authentication method uses a username and password (typically a personal access token) to access your repository.
When to use HTTP basic authentication
Use HTTP basic authentication when:
- Your Git repository requires authentication and uses an HTTP or HTTPS URL
- You want to use a personal access token instead of SSH keys
- Your organization’s security policies require token-based authentication
- You need to access repositories on platforms like GitHub, GitLab, or Bitbucket with HTTPS URLs
Prerequisites
- IAG secret store configured with an encryption key. See Configure IAG secret store.
- A personal access token or password for your Git repository
- Administrator role permissions to create secrets and repositories
How HTTP basic authentication works
IAG stores your authentication credentials securely:
- You create a secret that contains your password or personal access token
- You create a repository and reference the secret by name
- When a service runs, IAG uses the stored credentials to access the repository
IAG never exposes your password or token in plain text.
Create a secret for your authentication token
Before you create a repository with HTTP basic authentication, create a secret to store your personal access token or password.
Use the iagctl create secret command with the --prompt-value flag:
Example:
When prompted, enter your token. IAG encrypts and stores the token securely.
Create a repository with HTTP basic authentication
After you create a secret, you can create a repository that uses HTTP basic authentication.
Syntax:
Parameters:
Example — create a repository that uses GitHub authentication:
Complete example workflow
This example shows the complete process of setting up HTTP basic authentication for a GitHub repository.
ß