Introduction to IdentityStore and Authentication Mechanism
Explore how IdentityStore validates user credentials and retrieves identity attributes in JakartaEE. Understand how authentication mechanisms like HttpAuthenticationMechanism interact with security contexts and application roles. Learn practical aspects of handling authentication and logout in Java EE security.
We'll cover the following...
Overview
The official definition of the IdentityStore is as follows:
IdentityStore is a mechanism for validating a caller’s credentials and accessing a caller’s identity attributes. It can be used as an authentication mechanism.
The IdentityStore is responsible for determining whether user credentials are correct. We declared a custom class that implements the javax.security.enterprise.identitystore.IdentityStore interface as a CDI bean in the lesson "Callback Handlers." Since the IdentityStore is also responsible for retrieving the user’s attributes, such as the groups to which they are assigned, we have two main methods in the interface.
CredentialValidationResult validate(Credential credential);Set<String> getCallerGroups(CredentialValidationResult validationResult);
By default, both actions are ...