Top Description Methods
jakarta.security.enterprise.identitystore

public @Interface DatabaseIdentityStoreDefinition

extends Annotation
Annotations
@Retention:RUNTIME
@Target:TYPE
Static Imports
jakarta.security.enterprise.identitystore.IdentityStore.ValidationType.PROVIDE_GROUPS, .IdentityStore.ValidationType.VALIDATE, java.lang.annotation.ElementType.TYPE, .RetentionPolicy.RUNTIME

Annotation used to define a container-provided IdentityStore that stores caller credentials and identity attributes in a relational database, and make that implementation available as an enabled CDI bean.

The container-provided IdentityStore must support validating UsernamePasswordCredential, and may support validating other credential types.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

SQL query to validate
callerQuery
()

SQL query to validate the {caller, password} pair.

public String

Returns:

Full JNDI name of the data source
dataSourceLookup
()

Full JNDI name of the data source that provides access to the data base where the caller identities are stored.

public String

Returns:

SQL query to retrieve the groups
groupsQuery
()

SQL query to retrieve the groups associated with the caller when authentication succeeds.

public Class<? extends PasswordHash>

Returns:

The password hash used to verify plaintext passwords.
hashAlgorithm
()

A PasswordHash implementation used to verify plaintext passwords by generating a hash of the password and comparing it against the hashed value returned from the database via the callerQuery().

public String[]

Returns:

The algorithm parameters.
hashAlgorithmParameters
()

Used to specify algorithm-specific parameters.

public int

Returns:

the priority.
priority
()

Determines the order in case multiple IdentityStores are found.

public String

Returns:

the priority Jakarta Expression Language expression
priorityExpression
()

Allow priority to be specified as a Jakarta Expression Language expression.

public IdentityStore.ValidationType[]

Returns:

the type the identity store is used for
useFor
()

Determines what the identity store is used for

public String

Returns:

the useFor Jakarta Expression Language expression
useForExpression
()

Allow useFor to be specified as an Jakarta Expression Language expression.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

callerQueryback to summary
public String callerQuery()

SQL query to validate the {caller, password} pair. Only needed when useFor() contains ValidationType#VALIDATE.

The name of the caller that is to be authenticated has to be set as the one and only placeholder. The (hashed) password should be in the first column of the result.

Example query:


select password from callers where name = ?

Returns:String

SQL query to validate

dataSourceLookupback to summary
public String dataSourceLookup()

Full JNDI name of the data source that provides access to the data base where the caller identities are stored.

Returns:String

Full JNDI name of the data source

groupsQueryback to summary
public String groupsQuery()

SQL query to retrieve the groups associated with the caller when authentication succeeds. Only needed when useFor() contains ValidationType#PROVIDE_GROUPS.

The name of the caller that has been authenticated has to be set as the one and only placeholder. The group name should be in the first column of the result.

Example query:


select group_name from caller_groups where caller_name = ?

Returns:String

SQL query to retrieve the groups

hashAlgorithmback to summary
public Class<? extends PasswordHash> hashAlgorithm()

A PasswordHash implementation used to verify plaintext passwords by generating a hash of the password and comparing it against the hashed value returned from the database via the callerQuery().

Returns:Class<? extends PasswordHash>

The password hash used to verify plaintext passwords.

hashAlgorithmParametersback to summary
public String[] hashAlgorithmParameters()

Used to specify algorithm-specific parameters.

Parameters are specified as a list of name/value pairs, using the format below:

parameterName=parameterValue
 

For example:

 Algorithm.param1="value"
 Algorithm.param2=32
 

This attribute supports immediate Jakarta Expression Language expressions (${} syntax) for both the parameterValue as well as for a full array element. If an EL expression is used for a full array element, the expression must evaluate to either a single string, a string array or a string Stream where in each case every string must adhere to the above specified format.

Returns:String[]

The algorithm parameters.

priorityback to summary
public int priority()

Determines the order in case multiple IdentityStores are found.

Returns:int

the priority.

priorityExpressionback to summary
public String priorityExpression()

Allow priority to be specified as a Jakarta Expression Language expression. If set, overrides any value set with priority.

Returns:String

the priority Jakarta Expression Language expression

useForback to summary
public IdentityStore.ValidationType[] useFor()

Determines what the identity store is used for

Returns:IdentityStore.ValidationType[]

the type the identity store is used for

useForExpressionback to summary
public String useForExpression()

Allow useFor to be specified as an Jakarta Expression Language expression. If set, overrides any value set with useFor.

Returns:String

the useFor Jakarta Expression Language expression