Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. loginsrv

loginsrv

MITGov1.3.1

A standalone JWT login microservice with pluggable backends including OAuth2, htpasswd, and OSIAM.

GitHubGitHub
1.9k stars148 forks0 contributors

What is loginsrv?

loginsrv is a minimalistic login server that provides JWT-based authentication for various login backends. It enables secure user authentication as a standalone service, Docker container, Go library, or Caddy plugin, simplifying integration across different environments.

Target Audience

Developers and DevOps engineers building microservices or web applications that need a lightweight, standalone authentication layer without heavy dependencies. It's particularly useful for teams using Caddy server or containerized deployments.

Value Proposition

Developers choose loginsrv for its simplicity, modularity, and flexibility in deployment options, including direct integration as a Caddy plugin. It supports multiple authentication backends (OAuth2, htpasswd, simple user/password) and provides JWT token management with configurable security controls.

Overview

JWT login microservice with plugable backends such as OAuth2, Google, Github, htpasswd, osiam, ..

Use Cases

Best For

  • Adding JWT-based authentication to microservices architectures as a standalone service.
  • Integrating authentication into Caddy server deployments via its plugin system.
  • Containerized applications needing a lightweight authentication service in Docker.
  • Projects requiring support for multiple OAuth2 providers (GitHub, Google, Bitbucket, Facebook, Gitlab).
  • Simple authentication scenarios using htpasswd files or basic user/password pairs.
  • Customizing login forms and JWT claims with templating and user-specific data files or endpoints.

Not Ideal For

  • Projects requiring built-in user registration and management systems, as loginsrv only handles authentication without user lifecycle features.
  • Applications needing SAML, LDAP, or other advanced identity protocols not supported by its current OAuth2 and basic backends.
  • Teams looking for a fully managed authentication service with GUI administration, as loginsrv is self-hosted and minimalistic.

Pros & Cons

Pros

Flexible Authentication Backends

Supports multiple providers including OAuth2 (GitHub, Google, etc.), htpasswd, and simple user/password, allowing integration with various systems as listed in the Supported Provider Backends section.

Versatile Deployment Options

Can be run as a standalone microservice, Docker container, Go library, or Caddy plugin, offering flexibility for different environments, as highlighted in the Abstract and Startup Examples.

Configurable JWT Management

Provides extensive JWT options like expiry duration, signing algorithms (e.g., HS512, ES256), and refresh mechanisms via config parameters such as -jwt-expiry and -jwt-refreshes, detailed in the Config Options.

Customizable UI Templates

Allows custom HTML templates for the login form and user info pages using the -template parameter, enabling branding and layout changes, as explained in the Templating section.

Cons

HTTP Testing Complexity

Since v1.3.0, pure HTTP is not supported by default, requiring the -cookie-secure=false flag for development and testing, which adds an extra step and potential misconfiguration risk.

Limited Advanced Features

Lacks built-in support for multi-factor authentication, user management, or protocols like SAML and LDAP, restricting it to basic authentication flows without additional tooling.

Configuration Overhead

With numerous config options and environment variables, setting up loginsrv correctly can be complex and error-prone, especially for intricate multi-provider or custom claim setups.

Frequently Asked Questions

Quick Stats

Stars1,931
Forks148
Contributors0
Open Issues22
Last commit5 years ago
CreatedSince 2016

Tags

#caddy#service#oauth2#authentication#microservice#jwt#security#single-sign-on#docker#golang#backend#htpasswd#go#login#github

Built With

G
Go
D
Docker

Included in

Go169.1k
Auto-fetched 5 hours ago

Related Projects

casbincasbin

Apache Casbin: an authorization library that supports access control models like ACL, RBAC, ABAC.

Stars20,286
Forks1,754
Last commit1 day ago
jwt-gojwt-go

Go implementation of JSON Web Tokens (JWT).

Stars9,175
Forks439
Last commit18 days ago
spicedbspicedb

Open Source, Google Zanzibar-inspired database for scalably storing and querying fine-grained authorization data

Stars6,880
Forks406
Last commit6 hours ago
gothgoth

Package goth provides a simple, clean, and idiomatic way to write authentication packages for Go web applications.

Stars6,575
Forks631
Last commit5 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub