UserAuthenticator
, AuthenticationService
, ModuleControl
, ModuleSupportable
, PropertySetCallback
public final class BasicAuthenticationServiceImpl extends AuthenticationServiceBase implements UserAuthenticator
It instantiates and calls the basic User authentication scheme at runtime.
In 2.0, users can now be defined as database properties. If derby.database.propertiesOnly is set to true, then in this case, only users defined as database properties for the current database will be considered.
MODULE
authenticationScheme, AuthenticationTrace, SECMEC_USRSSBPWD
Constructor | Description |
---|---|
BasicAuthenticationServiceImpl() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
authenticateUser(java.lang.String userName,
java.lang.String userPassword,
java.lang.String databaseName,
java.util.Properties info) |
Authenticate the passed-in user's credentials.
|
void |
boot(boolean create,
java.util.Properties properties) |
Start this module.
|
boolean |
canSupport(java.util.Properties properties) |
Check if we should activate this authentication service.
|
private java.lang.String |
hashPasswordUsingStoredAlgorithm(java.lang.String user,
java.lang.String password,
java.lang.String storedPassword) |
Hash a password using the same algorithm as we used to generate the
stored password token.
|
apply, authenticate, getDatabaseProperties, getDatabaseProperty, getProperty, getServiceModule, getServiceName, getSystemCredentialsDatabaseName, getSystemProperty, getTransaction, hashPasswordSHA1Scheme, hashUsingDefaultAlgorithm, init, map, parsePasswordLifetime, parsePasswordThreshold, requireAuthentication, setAuthenticationService, stop, substitutePassword, validate
public boolean canSupport(java.util.Properties properties)
canSupport
in interface ModuleSupportable
public void boot(boolean create, java.util.Properties properties) throws StandardException
AuthenticationServiceBase
boot
in interface ModuleControl
boot
in class AuthenticationServiceBase
StandardException
- upon failure to load/boot the expected
authentication service.ModuleControl.boot(boolean, java.util.Properties)
public boolean authenticateUser(java.lang.String userName, java.lang.String userPassword, java.lang.String databaseName, java.util.Properties info) throws java.sql.SQLException
authenticateUser
in interface UserAuthenticator
userName
- The user's name used to connect to JBMS systemuserPassword
- The user's password used to connect to JBMS systemdatabaseName
- The database which the user wants to connect to.info
- Additional jdbc connection info.java.sql.SQLException
- An exception processing the request,
connection request will be denied. The SQL exception will
be returned to the connection attempt.private java.lang.String hashPasswordUsingStoredAlgorithm(java.lang.String user, java.lang.String password, java.lang.String storedPassword) throws StandardException
user
- the user whose password to hashpassword
- the plaintext passwordstoredPassword
- the password token that's stored in the databaseStandardException
- if the password cannot be hashed with the
requested algorithmApache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.