Top Description Methods
javax.security.enterprise.identitystore

public Interface RememberMeIdentityStore

Imports
java.util.Set, javax.security.auth.message.module.ServerAuthModule, javax.security.enterprise.CallerPrincipal, javax.security.enterprise.authentication.mechanism.http.RememberMe, .HttpAuthenticationMechanism, javax.security.enterprise.credential.RememberMeCredential

RememberMeIdentityStore is a mechanism for validating a caller's credentials and accessing a caller's identity attributes that's specifically tailored for the "remember me" feature.

This is not intended to be directly used by an authentication mechanism such as the JSR 375 HttpAuthenticationMechanism or the JSR 196 (JASPIC) ServerAuthModule. Instead, the interceptor implementation backing the RememberMe annotation is intended to use this.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

A token that can be used to get the principal and groups back at a later time.
generateLoginToken
(CallerPrincipal
The principal to be associated.
callerPrincipal
,
Set<String>
The groups the principal is in.
groups
)

Associates the given principal and groups with a token.

public void
removeLoginToken(String
The token that is to be removed.
token
)

Dissociates the principal and groups that were associated with the token before and removes the token itself.

public CredentialValidationResult

Returns:

The validation result, including associated caller groups.
validate
(RememberMeCredential
The credential to validate.
credential
)

Validates the given credential.

Method Detail

generateLoginTokenback to summary
public String generateLoginToken(CallerPrincipal callerPrincipal, Set<String> groups)

Associates the given principal and groups with a token.

The token generated by this method is intended to be used with the RememberMeCredential and passed into the validate(RememberMeCredential) method.

Parameters
callerPrincipal:CallerPrincipal

The principal to be associated.

groups:Set<String>

The groups the principal is in.

Returns:String

A token that can be used to get the principal and groups back at a later time.

removeLoginTokenback to summary
public void removeLoginToken(String token)

Dissociates the principal and groups that were associated with the token before and removes the token itself.

If the token did not exist (i.e. no principal and groups were associated with that token) no exception will be thrown.

Parameters
token:String

The token that is to be removed.

validateback to summary
public CredentialValidationResult validate(RememberMeCredential credential)

Validates the given credential.

Parameters
credential:RememberMeCredential

The credential to validate.

Returns:CredentialValidationResult

The validation result, including associated caller groups.