token based authentication middleware for net/http