Practical Golang: Writing a simple login middleware

Introduction In this part we’ll be creating a simple middleware you can easily apply to your handlers to get authentication/authorization. Middleware like this is an awesome way to add additional functionality to your Go server. Here we will only do authorization as we will only ask for a password, not a login. Although if you want, then you can easily extend this system to any authentication/authorization you’d like. Implementation We will mainly use the stdlib, and will use cookies to remember who’s already logged in....

April 6, 2016 · 5 min · Jacob Martin