O'Reilly logo

Distributed Computing with Go by V.N. Nikhil Anurag

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Authorization on a web server

Our search application trusts every incoming request. However, sometimes restricting access might be the right way to go. It would be desirable if, for every incoming request, we could accept and identify requests from certain users. This can be achieved using authorization tokens (auth tokens). An auth token is a secret code/phrase sent in the header for the key, Authorization.

Authorization and auth tokens are deep and important topics. It would not be possible to cover the complexity of the subject in this section. Instead, we will build a simple server that will make use of auth tokens to accept or reject a request. Let us look at the source code.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required