Authentication failed when login from VS code and Cursor
- In VS code and Cursor, click `🔐Start Login';
- Open in external browser;
http://localhost:7864/opened;- Login with my account;
- Redirect to
http://localhost:7865/callback?plat=deepvlab&token=xxxx; - End with
Authentication failed: Invalid URL protocol: the URL must start with http: or https:.
- In VS code and Cursor, click `🔐Start Login';
- Open in external browser;
http://localhost:7864/opened;- Login with my account;
- Redirect to
http://localhost:7865/callback?plat=deepvlab&token=xxxx;- End with
Authentication failed: Invalid URL protocol: the URL must start with http: or https:.![]()
We couldn’t reproduce this issue on our side, but we noticed that by default, the login welcome page runs on port 7862, and the callback page runs on 7863. In your case, it seems those default ports might have been occupied, causing the system to switch to different ones (7864 / 7865). This often happens when another background process or host is already using the same ports.
Suggested steps:
Restart your computer, or use the terminal to check which processes are occupying ports 7862 and 7863, then completely kill those processes. Close your IDE. Try the authentication process again. If the issue persists, please open the browser console when you see the “Authentication failed” message, locate the failed request, and share the raw response body with us. That will help us investigate further.
Thank you!
I just tried again, and it does open 7862 first, with the callback being 7863; it still failed; when I tried again, it became 7864->7865.
Request url:
http://localhost:7865/callback?plat=deepvlab&token=xxxxxx&user_id=xxxxxx
Request status:
400 Bad Request
Request response body:
<!DOCTYPE html>
<html>
<head>
<title data-i18n="auth.error.title">Authentication Error</title>
<meta charset="utf-8">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
background: #ffffff;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
color: #1a1a1a;
}
.container {
background: #ffffff;
border-radius: 12px;
padding: 48px 32px;
max-width: 400px;
width: 100%;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
border: 1px solid #e5e5e5;
text-align: center;
animation: fadeIn 0.3s ease;
}
.error {
font-size: 48px;
margin-bottom: 20px;
color: #ef4444;
line-height: 1;
}
.title {
font-size: 24px;
font-weight: 600;
color: #1a1a1a;
margin-bottom: 12px;
letter-spacing: -0.01em;
}
.message {
color: #6b7280;
font-size: 16px;
margin-bottom: 32px;
line-height: 1.5;
padding: 16px;
background: #fef2f2;
border-radius: 8px;
border: 1px solid #fecaca;
}
.instruction {
color: #374151;
font-size: 14px;
font-weight: 500;
padding: 16px;
background: #f9fafb;
border-radius: 8px;
border: 1px solid #f3f4f6;
line-height: 1.4;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@media (max-width: 480px) {
body {
padding: 16px;
}
.container {
padding: 32px 24px;
}
.error {
font-size: 40px;
}
.title {
font-size: 20px;
}
.message {
font-size: 14px;
margin-bottom: 24px;
padding: 12px;
}
.instruction {
padding: 12px;
font-size: 13px;
}
}
</style>
</head>
<body>
<div class="container">
<div class="error">✕</div>
<h1 class="title" data-i18n="auth.error.title">Authentication Failed</h1>
<div class="message">Invalid URL protocol: the URL must start with `http:` or `https:`.</div>
<div class="instruction" data-i18n="auth.error.instruction">Please close this page and try again in your terminal or IDE.</div>
</div>
<script>
// 国际化翻译对象
const translations = {
en: {
'auth.feishu.success.title': 'Feishu Login Successful',
'auth.deepvlab.success.title': 'DeepVlab Login Successful',
'auth.success.message': 'You have successfully logged in. You can now close this page and return to DeepV Code to continue your work.',
'auth.success.instruction': 'Close this page and return to your terminal or IDE to continue using DeepV Code.',
'auth.error.title': 'Authentication Failed',
'auth.error.instruction': '❌ Please close this page and try again in your terminal or IDE.'
},
zh: {
'auth.feishu.success.title': '飞书登录成功',
'auth.deepvlab.success.title': 'DeepVlab登录成功',
'auth.success.message': '您已成功登录。现在可以关闭此页面并返回 DeepV Code 继续您的工作。',
'auth.success.instruction': '关闭此页面并返回终端或IDE以继续使用 DeepV Code。',
'auth.error.title': '认证失败',
'auth.error.instruction': '❌ 请关闭此页面并在终端或IDE中重试。'
}
};
// 获取浏览器语言
function getBrowserLanguage() {
const lang = navigator.language || navigator.userLanguage;
return lang.startsWith('zh') ? 'zh' : 'en';
}
// 翻译函数
function t(key) {
const locale = getBrowserLanguage();
return translations[locale][key] || translations.en[key] || key;
}
// 初始化页面文本
function initI18n() {
document.querySelectorAll('[data-i18n]').forEach(element => {
const key = element.getAttribute('data-i18n');
const text = t(key);
element.textContent = text;
// 同时更新title属性(如果是title标签)
if (element.tagName === 'TITLE') {
document.title = text;
}
});
}
// 页面加载时初始化i18n
document.addEventListener('DOMContentLoaded', function() {
initI18n();
});
</script>
</body>
</html>
I found this issue in VSCODE. Is this the reason?
I found this issue in VSCODE. Is this the reason?
Yes, I guess it’s a similar issue. Fortunately, we have an alternative solution.
You can log in once through our CLI, and the VS Code extension will use the same login information — so you won’t need to log in again from the extension.
Installing the CLI is very simple:
npm install -g deepv-code
If you prefer using Bun, you can use it as well.
I found this issue in VSCODE. Is this the reason?
I realized that if you’re running your own built or debug version of the source code, please note the following:
-
You’ll need to run it together with the open-source server:
👉 https://github.com/OrionStarAI/DeepVCode-Server-mini -
To bypass authentication and allow the client to connect to your own server:
Locate the .deepv/ folder in your user home directory:
- macOS:
~/.deepv/settings.jsonor/Users/your-username/.deepv/settings.json - Windows:
C:\Users\your-username\.deepv\settings.json
Open the
settings.jsonfile and add or modify thecustomProxyServerUrlconfiguration, for example:{ "customProxyServerUrl": "http://localhost:3001" }Then restart the CLI for the configuration to take effect.
- macOS:
With this setup, both VSCode and CLI will skip authentication and connect directly to your own server at http://localhost:3001.
I found this issue in VSCODE. Is this the reason?
I realized that if you’re running your own built or debug version of the source code, please note the following:
You’ll need to run it together with the open-source server: 👉 https://github.com/OrionStarAI/DeepVCode-Server-mini
To bypass authentication and allow the client to connect to your own server: Locate the .deepv/ folder in your user home directory:
- macOS:
~/.deepv/settings.jsonor/Users/your-username/.deepv/settings.json- Windows:
C:\Users\your-username\.deepv\settings.jsonOpen the
settings.jsonfile and add or modify thecustomProxyServerUrlconfiguration, for example: { "customProxyServerUrl": "http://localhost:3001" }Then restart the CLI for the configuration to take effect.
With this setup, both VSCode and CLI will skip authentication and connect directly to your own server at http://localhost:3001.
I'm not using my own server, I just install the extension in VS Code.
I've already installed via npm and logged in successfully. However, I still can't log in to VS Code. What should I do?
I've already installed via npm and logged in successfully. However, I still can't log in to VS Code. What should I do?
What's your version code of the VS Code? And try to uninstall extension.
It works after upgrade VS Code and reinstall extension.