|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Realm
An interface to realms.
Based on Realm in the Apache Jakarta Tomcat project.
| Field Summary | |
|---|---|
static String |
ANONYMOUS_USER_PROPERTY
The anonymous user property. |
static String |
CACHED_PASSWORDS_PROPERTY
The cached passwords property. |
static String |
DEFAULT_ROLE_PROPERTY
The default role property. |
static String |
DIGEST_ALGORITHM_PROPERTY
The digest algorithm property. |
static String |
MEMBER_PROPERTY
The member property. |
static String |
PUBLIC_NAME_PROPERTY
The public name property. |
| Method Summary | |
|---|---|
Principal |
authenticate(Certificate[] certs)
Authenticates the principal with a certificate. |
Principal |
authenticate(Principal principal,
String scheme)
Authenticates the specified principal in this realm. |
Principal |
authenticate(String domain,
Certificate[] certs)
Authenticates the principal with a certicate in the specified domain. |
Principal |
authenticate(String domain,
Principal principal,
String scheme)
Authenticates the specified principal in the specified domain of this realm. |
Principal |
authenticate(String username,
String password,
String scheme)
Authenticates the principal associated with the specified username and password using the specified scheme, if there is one. |
Principal |
authenticate(String domain,
String username,
String password,
String scheme)
Authenticates the principal associated with the specified username and password in the specified domain using the specified scheme, if there is one. |
Principal |
authenticate(String username,
String realmname,
String resp,
String nonce,
String nc,
String cnonce,
String qop,
String md5a2,
String encoding)
Authenticates the principal associated with the specified username matching the digest calculated using the given parameters using the method described in RFC2617/2831. |
Principal |
authenticate(String domain,
String username,
String realmname,
String resp,
String nonce,
String nc,
String cnonce,
String qop,
String md5a2,
String encoding)
Authenticates the principal associated with the specified username in the specified domain matching the digest calculated using the given parameters using the method described in RFC2617/2831. |
String |
digest(String username,
String password)
Digests the password for the specified username using the defined algorithm and converts the result to a corresponding hexadecimal string. |
String |
generateAuthenticate(String username,
String password,
String scheme)
Generates the authentication header. |
String |
getAnonymousUser()
Gets the username for anonymous principals. |
String |
getAuthType()
Gets the authentication scheme. |
String |
getDefaultRole()
Gets the default role of authenticated principals. |
String |
getDigestAlgorithm()
Gets the digest algorithm used to store credentials. |
String |
getPublicName()
Gets the public name of this realm. |
Principal |
identify(String identity)
Identifies the principal associated with the specified identity. |
Principal |
identify(String username,
String password)
Identifies the principal associated with the specified username and password. |
boolean |
isAuthenticated(Principal principal)
Checks whether the specified principal is authenticated in this realm. |
boolean |
isAuthenticated(String domain,
Principal principal)
Checks whether the specified principal is authenticated in the specified domain of this realm. |
boolean |
isCachedPasswords()
Checks whether non-digested client passwords are cached. |
boolean |
isUserInRole(Principal principal,
String role)
Checks whether the specified principal is in the specified security role within the context of any domain in this realm. |
void |
setAnonymousUser(String username)
Sets the username for anonymous principals. |
void |
setCachedPasswords(boolean flag)
Sets the option to cache non-digested client passwords of authenticated principals to be used in e.g. |
void |
setDefaultRole(String role)
Sets the default role of authenticated principals. |
void |
setDigestAlgorithm(String digest)
Sets the digest algorithm used to store credentials. |
void |
setPublicName(String name)
Sets the public name of this realm. |
| Methods inherited from interface org.norther.tammi.core.config.Configurable |
|---|
addProperty, addProperty, clearProperties, containsProperty, getConfigKey, getProperties, getProperty, getPropertyFilePath, indexOfProperty, propertyMap, propertyMap, removeProperty, removeProperty, setConfigKey, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, storeProperties |
| Field Detail |
|---|
static final String PUBLIC_NAME_PROPERTY
static final String DIGEST_ALGORITHM_PROPERTY
static final String CACHED_PASSWORDS_PROPERTY
static final String DEFAULT_ROLE_PROPERTY
static final String ANONYMOUS_USER_PROPERTY
static final String MEMBER_PROPERTY
| Method Detail |
|---|
String getPublicName()
void setPublicName(String name)
Note that if both the digest algorithm and the public name are defined, the digested passwords must include the username and the realmname in the form: <username>:<realmname>:<password>.
name - the public name.String getDigestAlgorithm()
void setDigestAlgorithm(String digest)
digest - the digest algorithm.boolean isCachedPasswords()
void setCachedPasswords(boolean flag)
flag - the cached passwords option.String getDefaultRole()
void setDefaultRole(String role)
role - the default role.String getAnonymousUser()
void setAnonymousUser(String username)
Note that the anonymous user must be known within the realm but its credentials are not necessarily verified during authentication.
username - the default guest.
boolean isUserInRole(Principal principal,
String role)
principal - the principal for whom the role is to be checked.role - the security role to be checked.
boolean isAuthenticated(Principal principal)
principal - the principal to be checked.
boolean isAuthenticated(String domain,
Principal principal)
domain - the domain of the user.principal - the principal to be checked.
Principal identify(String identity)
identity - the identity.
Principal identify(String username,
String password)
username - the username.password - the password.
Principal authenticate(Principal principal,
String scheme)
principal - principal to be authenticated.scheme - the authentication scheme to be applied.
Principal authenticate(String domain,
Principal principal,
String scheme)
domain - the domain of the user.principal - principal to be authenticated.scheme - the authentication scheme to be applied.
Principal authenticate(String username,
String password,
String scheme)
The username can be null or empty for an anonymous authentication.
username - the username to look up.password - the password to use in authentication.scheme - the authentication scheme to be applied.
Principal authenticate(String domain,
String username,
String password,
String scheme)
The username can be null or empty for an anonymous authentication.
domain - the domain of the user.username - the username to look up.password - the password to use in authentication.scheme - the authentication scheme to be applied.
Principal authenticate(String username,
String realmname,
String resp,
String nonce,
String nc,
String cnonce,
String qop,
String md5a2,
String encoding)
Note that either non-encrypted or MD5 digested passwords must be applied. Digested passwords must include the username and realmname in the form: <username>:<realmname>:<password>.
The username can be null or empty for an anonymous authentication.
username - the username to look up.realmname - the realm, i.e. the identification of the server.resp - the digest which has been submitted by the client.nonce - a unique token which has been used for this request.nc - a nonce count.cnonce - a client nonce.qop - the quality of protection ("auth", "auth-int",...)md5a2 - the second MD5 digest used to calculate the digest:
MD5(Method + ':' + uri).encoding - the chareacter encoding to apply.
Principal authenticate(String domain,
String username,
String realmname,
String resp,
String nonce,
String nc,
String cnonce,
String qop,
String md5a2,
String encoding)
Note that either non-encrypted or MD5 digested passwords must be applied. Digested passwords must include the username and realmname in the form: <username>:<realmname>:<password>.
The username can be null or empty for an anonymous authentication.
domain - the domain of the user.username - the username to look up.realmname - the realm, i.e. the identification of the server.resp - the digest which has been submitted by the client.nonce - a unique token which has been used for this request.nc - a nonce count.cnonce - a client nonce.qop - the quality of protection ("auth", "auth-int",...)md5a2 - the second MD5 digest used to calculate the digest:
MD5(Method + ':' + uri).encoding - the character encoding to apply.
Principal authenticate(Certificate[] certs)
certs - the peer certificate chain.
Principal authenticate(String domain,
Certificate[] certs)
domain - the domain of the user.certs - the peer certificate chain.
String getAuthType()
String generateAuthenticate(String username,
String password,
String scheme)
The username can be null or empty for an anonymous authentication.
username - the username to look up.password - the password to use in authentication.scheme - the authentication scheme to be used.
UnsupportedOperationException - if not supported.
String digest(String username,
String password)
username - the username.password - the password or other credentials.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||