Tailscale LocalAPI

Context I use Tailscale to secure network communication, and I wanted to authenticate users coming from the Tailscale network. The goal was to reproduce the behavior in the golink application. When users come from the Tailscale network, the application should authenticate them and give them access to the application based on roles defined in Tailscale ACL. Solution Tailscale exposes an HTTP API through a Unix Socket named LocalAPI. It can be used for many things. In my case, I needed to authenticate a user coming from Tailnet. I used it to get information about a Tailscale user by calling the whois endpoint. ...

December 26, 2024 · 2 min · Dorian Monnier