github.com/hailiang/httpauth

Golang HTTP session authentication


License
MIT
Install
go get github.com/hailiang/httpauth

Documentation

Go Session Authentication

Build Status Coverage GoDoc

This package uses the Gorilla web toolkit's sessions package to implement a user authentication and authorization system for Go web servers.

Multiple user data storage backends are available, and new ones can be implemented relatively easily.

Access can be restricted by a users' role.

Uses bcrypt for password hashing.

Run go run server.go from the examples directory and visit localhost:8009 for an example. You can login with the username and password "admin".

Tests can be run by simulating Travis CI's build environment. There's a very unsafe script --- start-test-env.sh that will do this for you.

You should follow me on Twitter.

TODO

  • User roles - modification
  • SMTP email validation (key based)
  • More backends
  • Possible remove dependance on bcrypt