Skip to content
golang htpasswd utilities
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Travis CI

This is a simple utility library to manipulate htpasswd files

If you want to authenticate against a htpasswd file use something like .

Supported hashing algorithms:

  • sha (do not use except for legacy support situations)
  • bcrypt

This is what you can

Set user credentials in a htpasswd file:

file := "/tmp/demo.htpasswd"
name := "joe"
password := "secret"
err := htpasswd.SetPassword(file, name, password, htpasswd.HashBCrypt)

Remove a user:

err := htpasswd.RemoveUser(file, name)

Read user hash table:

passwords, err := htpasswd.ParseHtpasswdFile(file)

Have fun.

You can’t perform that action at this time.