Skip to content
RahmannugarPublic

About

A composable authentication library for Go applications, providing email and password authentication, session management, MFA, passkeys, OAuth, and SSO through OIDC and SAML.

Topics

Resources

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Latest commit

 

History

38 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Authlier

Authlier is a composable authentication library for Go applications. It brings passwords, sessions, email verification and recovery, MFA, passkeys, Google authentication, OIDC, and SAML into your Go server through one configurable HTTP handler.

Authlier verifies identities and manages authentication records. Your application keeps control of profiles, roles, permissions, and other product data.

New passwords use Argon2id by default. Applications can select bcrypt when a legacy credential system requires temporary write compatibility; verification continues to recognize both formats for staged migration.

Installation

The current release is v0.5.0.

go get github.com/Rahmannugar/[email protected]

How it works

  1. Connect one of the official PostgreSQL, MySQL, MongoDB, or Redis adapters.
  2. Enable the authentication methods your application needs.
  3. Mount auth.Handler() in your Go server.
  4. Call auth.ResolveSession(request) from application routes that require an authenticated user.

With a connected pgxpool.Pool, a PostgreSQL setup looks like this:

database, err := postgres.New(pool, postgres.Config{})
if err != nil {
	return err
}
if err := database.Migrate(ctx); err != nil {
	return err
}

auth, err := authlier.New(authlier.Config{
	AppName:  "Acme",
	BaseURL:  "https://server.example.com",
	Database: database,
	EmailAndPassword: authlier.EmailAndPasswordConfig{
		Enabled: true,
	},
})
if err != nil {
	return err
}

http.Handle("/api/auth/", auth.Handler())

The complete Getting started guide builds a working server and explains each part of this setup.

Documentation

  • Basic usage connects a browser client to Authlier's routes.
  • Configuration covers route prefixes, browser origins, session modes, and authentication methods.
  • Bearer tokens covers web, mobile, CLI, and API clients that choose access and refresh tokens.
  • Storage explains the official database adapters and custom storage contracts.
  • Authentication guides begin with email and password, then cover verification, recovery, Google, TOTP, and passkeys.
  • Single sign-on explains the shared OIDC and SAML identity boundary.
  • HTTP routes lists the request and response contract for the configured handler.
  • Security explains secure deployment and the controls that remain the application's responsibility.
  • Architecture describes the internal package boundaries.

Security

Security reports should be submitted privately according to SECURITY.md.

Contributing

See CONTRIBUTING.md to report an issue, propose a change, or open a pull request.

License

Authlier is licensed under the Apache License 2.0.

About

A composable authentication library for Go applications, providing email and password authentication, session management, MFA, passkeys, OAuth, and SSO through OIDC and SAML.

Topics

Resources

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages