r/opencode • u/kevinpark1217 • 25d ago
I made OpenCode sign in to my self-hosted LLM with SSO, no more API keys 🎉
Hey everyone! 👋
My homelab runs llama.cpp and SearXNG behind Keycloak, and my family signs in with their own accounts. OpenCode was the last thing still asking for a static API key, so I fixed that.
opencode-oauth: run /connect, sign in through your identity provider in the browser, and you're in. OpenCode keeps the token fresh, and web search can use the same sign-in. The GIF shows the whole flow.
It should work with any OAuth 2.0 provider (Authentik, Authelia, Pocket ID, Entra ID…), but so far I've only run it with Keycloak. I'd love for you to try it with yours and tell me how it goes, good or bad!
Setup is one plugin entry: https://github.com/kevinpark1217/opencode-oauth
2
u/butterfly_labs 25d ago
Why not use a service account?
1
u/DrySpite5067 23d ago
there is no way u work in ~/tmp no way