tnAuth for VS Code Server
tnAuth can serve as VS Code Server external authentication proxy server. It requires Code to run behind a
reverse proxy, Nginx for example, and a few additional configurations as below.
- Code config
socket: /run/vscode.sock
socket-mode: 0666
auth: none
cert: false
... # your other settings
- Nginx config
server {
...
location / {
auth_request /auth;
auth_request_set $auth_status $upstream_status;
proxy_pass unix:/run/vscode.sock;
... # your other settings
}
location /auth {
internal;
proxy_pass https://api.tinyray.com/auth[.pid]; # pid is optional
proxy_set_header Authentication "Your-tnAuth-name";
proxy_set_header Content-Length "";
proxy_pass_request_body off;
}
location /login {
proxy_pass https://api.tinyray.com/auth[.pid]; # pid is optional
proxy_set_header Host $host;
proxy_set_header Authorization "Your-tnAuth-name";
proxy_set_header X-Original-URI $request_uri;
}
error_page 401 /login;
}
You can now login Code using any social network account, Facebook for example, which uses the
same email once used for tnAuth registration.