As a part of the Java Security API, the container must provide HttpAuthenticationMechanism implementations for three authentication mechanisms. The three implementations are:
- Basic HTTP authentication
- Form-based authentication
- Custom-form authentication
Each of these implementations can be triggered by the use of the following annotations:
- @BasicAuthenticationMechanismDefinition
- @FormAuthenticationMechanismDefinition
- @CustomFormAuthenticationMechanismDefinition
When we use any of these annotations in the code, the container will instantiate an instance of the associated implementation.
Let's take a look at these three mechanisms, one by one.