public class Realm
extends Object
The format of the configuration properties file is:
identifier: password [,rolename . . .]
Modifier and Type | Field and Description |
---|---|
static String |
CRYPT_PREFIX
CRYPT prefix.
|
static Identity |
UNKNOWN_IDENTITY
Unknown identity.
|
Constructor and Description |
---|
Realm()
Constructs an instance.
|
Modifier and Type | Method and Description |
---|---|
Optional<Identity> |
authenticate(String identifier,
Object credential)
Authenticates an identity.
|
Identity |
getIdentity(Optional<String> identifier)
Gets the identity for an identifier.
|
protected Logger |
getThisLogger()
Gets the logger.
|
boolean |
isConfigured()
Asks if this realm is configured.
|
boolean |
isInRoles(Optional<String> identifier,
String[] roles)
Asks if an identity acts as one of the specified roles.
|
protected Identity |
newIdentity(String identifier,
Credential credential,
Set<String> roles)
Returns a new identity.
|
boolean |
setUp(KeyedGroups realmProperties,
SecurityContext securityContext)
Sets up this.
|
public static final String CRYPT_PREFIX
public static final Identity UNKNOWN_IDENTITY
@Nonnull @CheckReturnValue public Optional<Identity> authenticate(@Nonnull String identifier, @Nonnull Object credential)
identifier
- The identifier for the identity.credential
- The credential.@Nonnull @CheckReturnValue public Identity getIdentity(@Nonnull Optional<String> identifier)
identifier
- The optional identifier.@CheckReturnValue public boolean isConfigured()
@CheckReturnValue public boolean isInRoles(@Nonnull Optional<String> identifier, @Nonnull String[] roles)
identifier
- The optional identifier for the identity.roles
- The roles.@CheckReturnValue public boolean setUp(@Nonnull KeyedGroups realmProperties, @Nonnull SecurityContext securityContext)
realmProperties
- The realm configuration properties.securityContext
- The security context.@Nonnull @CheckReturnValue protected final Logger getThisLogger()
@Nonnull @CheckReturnValue protected Identity newIdentity(@Nonnull String identifier, @Nonnull Credential credential, @Nonnull Set<String> roles)
Allows subclasses to extend Identity
.
identifier
- The identifier.credential
- The credential.roles
- The roles.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.