# remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled

**Code:** `remote: HTTP Basic: Access denied (GitLab)` · **Category:** Git · **Seen on:** Git

GitLab rejected your HTTPS login.

## Meaning

With 2FA you must use a personal access token as the password. Check token scopes (`write_repository`) and expiry.

## Common causes

- 2FA enabled
- Token expired or missing scope
- Wrong username

## Quick fix

1. Create a PAT with `write_repository`
2. Use the token as password
3. Update the stored credential

## Detailed fix by platform

### Git

1. `git remote set-url origin https://oauth2:$TOKEN@gitlab.com/org/repo.git`

## How to diagnose

1. **2FA** — on?
2. **Token** — scope?
3. **Username** — right?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/git/gitlab-http-basic-access-denied)
