GitLab Token not working in VS Code

Hi All - I am trying to add my GitLab token to VSCode and I keep getting the following error message:

‘API Unauthorized: Can’t add GitLab account for https://gitlab.companyname.com. Is your token valid?
Source: GitLab Workflow (Extension)’

I have tried to reinstall the GitLab extension and even tried creating new tokens but nothing seems to be working.

1 Like

I met the same problem. Does anyone know how to solve it?

Hi hilinc. I tried using the token as a password in the search toolbar located on the top when prompted to connect and it somehow worked for me.

I found the answer on Fails to auth self-hosted gitlab due to new token validation (#1105) · Issues · GitLab.org / gitlab-vscode-extension · GitLab

For the VS Code extension we don’t actively support anything older than GitLab 16.1 - GitLab.org / gitlab-vscode-extension · GitLab. The endpoint we require to validate authentication was introduced in GitLab 15.5, so you’ll at least need to update to that version, but I’d suggest updating to something more recent.