JAAS modules used must have both a NameCallback and a PasswordCallback. This is how we pass the JDBC-provided user name and password to the module.
JAAS setup is Java-implementation-specific.
For Sun Java, you set up a JAAS configuration file which resides at
$HOME/.java.login.config or at the location that you set with
Java system property java.security.auth.login.config.
You can use this bean to manage just access, or also to manage roles or initial schemas. To use for roles or initial schemas, you must set the roleSchemaValuePattern property to distinguish which of the JAAS-module-provided values to use. By default, all JAAS-module-provided Principles will be candidates. If you set property roleSchemaViaCredential to true, then all JAAS-module-provided public Credentials will be candidates instead.
AuthFunctionBean, NameCallback, PasswordCallback
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private boolean | |
| private static FrameworkLogger | |
| private Pattern | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String[] | authenticate(String userName, String password)
Implements org. Return a list of authorized roles or null to indicate that the implementation does not intend to produce a specific role list but only to indicate whether to allow access or not. |
| public void | |
| public void | |
| public void | setRoleSchemaValuePattern(Pattern
pattern roleSchemaValuePattern)Assign a pattern to both detect honored values, and optionally to map from a single principal name or public credential string to a single HyperSQL role or schema string. |
| public void | setRoleSchemaValuePatternString(String
pattern patternString)String wrapper for method setRoleSchemaValuePattern(Pattern) Use the (x?) Pattern constructs to set options. |
| public void | setRoleSchemaViaCredential(boolean
boolean roleSchemaViaCredential)By default, If roleSchemaValuePattern is set, then role and schema values are obtained from principle values; otherwise existing account privileges are used (if any). |
| applicationKey | back to summary |
|---|---|
| private String applicationKey | |
| initialized | back to summary |
|---|---|
| private boolean initialized | |
| logger | back to summary |
|---|---|
| private static FrameworkLogger logger | |
| roleSchemaValuePattern | back to summary |
|---|---|
| private Pattern roleSchemaValuePattern | |
| roleSchemaViaCredential | back to summary |
|---|---|
| private boolean roleSchemaViaCredential | |
| JaasAuthBean | back to summary |
|---|---|
| public JaasAuthBean() | |
| authenticate | back to summary |
|---|---|
| public String[] authenticate(String userName, String password) throws DenyException Implements org. Doc from org. Return a list of authorized roles or null to indicate that the implementation does not intend to produce a specific role list but only to indicate whether to allow access or not. A return value of String[0] is different from returning null, and means that the user should not be granted any roles. | |
| init | back to summary |
|---|---|
public void init()
| |
| setApplicationKey | back to summary |
|---|---|
| public void setApplicationKey(String applicationKey) Set the key into the JAAS runtime configuration. For Sun's JAAS implementation, this is the "application" identifier for a stanza in the JAAS configuration file.
| |
| setRoleSchemaValuePattern | back to summary |
|---|---|
| public void setRoleSchemaValuePattern(Pattern roleSchemaValuePattern) Assign a pattern to both detect honored values, and optionally to map from a single principal name or public credential string to a single HyperSQL role or schema string. Do not use this method if you are using this JaasAuthBean only to permit or reject access (with roles and schema being determined by pre-existing local HyperSQL accounts). On that case, simple success of the login() method method will allow access as the specified user. If every principal name or public credentials holds only the String values precisely as HyperSQL needs them, then set the pattern to ".+". For example, if the JAAS module returns principals (or credentials) with values "one", "two", "three", then if you set this pattern to ".+", HyperSQL will attempt to assign initial schema and roles for the values "one", "two", and "three". These are two distinct and important purposes for the specified Pattern.
N.b. this Pattern will be used for the matches() operation, therefore it must match the entire candidate value strings (this is different than the find operation which does not need to satisfy the entire candidate value). Example1 :
will extract the CN value from matching attribute values.
Example1 :
will return the entire cn...com string for matching
attribute values.
| |
| setRoleSchemaValuePatternString | back to summary |
|---|---|
| public void setRoleSchemaValuePatternString(String patternString) String wrapper for method setRoleSchemaValuePattern(Pattern) Use the (x?) Pattern constructs to set options.
| |
| setRoleSchemaViaCredential | back to summary |
|---|---|
| public void setRoleSchemaViaCredential(boolean roleSchemaViaCredential) By default, If roleSchemaValuePattern is set, then role and schema values are obtained from principle values; otherwise existing account privileges are used (if any). If roleSchemaViaCredential is set to true and roleSchemaValuePattern is set, then credential values will be used instead. Do not set roleSchemaViaCredential to true unless roleSchemaValuePattern is set.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | handle(Callback[] callbacks)
Implements javax. Retrieve or display the information requested in the provided Callbacks. |
| UPCallbackHandler | back to summary |
|---|---|
| public UPCallbackHandler(String u, String pString) | |
| handle | back to summary |
|---|---|
| public void handle(Callback[] callbacks) throws UnsupportedCallbackException Implements javax. Doc from javax. Retrieve or display the information requested in the provided Callbacks. The
| |