Authentication mechanisms
Authentication mechanisms provide a way for the user to provide their credentials so that they can be authenticated against an identity store.
The Jakarta EE Security API provides support for the HTTP Basic authentication mechanism provided by most browsers, as well as form authentication, which is the most common authentication mechanism where users provide their credentials via an HTML form.
Form authentication by default submits a form to the security servlet provided by the Jakarta EE implementation. If we need more flexibility or to better align with other Jakarta EE technologies, the Security API provides custom form authentication as well, which allows us as application developers to have more control over how to authenticate users attempting to access our application.
Basic authentication mechanism
A basic authentication mechanism can be achieved by annotating the resource as secure (i.e, a servlet or RESTful web service) with the @
BasicAuthenticationMechanismDefinition...