Buffalo Basic Auth Middleware
Basic HTTP Authentication Middleware
for Buffalo
$ go get github.com/gobuffalo/mw-basicauth
auth := func(c buffalo.Context, u, p string) (bool, error) {
return (u == "username" && p == "password"), nil
}
app.Use(basicauth.Middleware(auth))
Base64 Encode username:password
, which becomes dXNlcm5hbWU6cGFzc3dvcmQK
in the aforementioned example
Then pass the following HTTP header along with all requests to protected endpoints: Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQK