Identity stores
Identity stores provide access to a persistence storage system, such as a relational or LDAP database, where user credentials are stored. The Jakarta EE Security API supports relational and LDAP databases directly, and it allows us to integrate with custom identity stores, if necessary.
Setting up an identity store stored in a relational database
To authenticate a secured resource, such as a servlet or RESTful web service, against credentials stored in a relational database, annotate an application-scoped CDI bean with the @DatabaseIdentityStoreDefinition
annotation, as illustrated in the following example:
package net.ensode.javaee8book.httpauthdatabaseidentitystore.security; //imports omitted for brevity @DatabaseIdentityStoreDefinition( dataSourceLookup = "java:global/jdbc/userauthdbDatasource", callerQuery = "select password from users where USERNAME = ?", ...