Implementing basic authorization

In this section, we will implement a very basic custom authorizer, which will decide whether to allow or disallow requests in the function of a hardcoded authorization token. This authorizer will not have any data layer at this stage but will be a great start for some real business logic, because in the next chapter, we will start with an authentication server that is injected to this authorizer lambda via the dependency injection pattern, and in the following chapter, we will connect it to a DynamoDB database for production quality authentication.

First, let's start writing some Java code for our authorizer. Now we will create a new Lambda function in its own module called lambda-authorizer. We can create ...

Get Building Serverless Architectures now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.