Search⌘ K
AI Features

DIY: Hands-on Base64

Explore how Basic authentication functions in web applications by learning the role of Base64 encoding in HTTP requests. Understand the step-by-step process of authenticating users with Authorization headers in Jakarta EE. Gain practical experience by creating a servlet that handles authentication and verifies user credentials.

Overview

We will demonstrate simple authentication using the Basic authenticationHTTP Basic Authentication (By default) requires the server to request a user name and password from the web client and verify them to a database of authorised users to ensure that they are legitimate. method in this lesson. Knowledge of Basic authentication is important for understanding other concepts, so we’ll spend some time looking under the hood to learn how the protocol works. We will not use the standardized methods available within Jakarta EE.

Basic authentication is a very simple technique that doesn’t require cookies, session identifiers, or login pages. It will not guarantee that the provided credentials can be trusted, since there is only a simple Base64 encoding of the provided username and password.

The following diagram shows the steps involved in authentication ...