public final class NativeAuthenticationServiceImpl extends AuthenticationServiceBase implements UserAuthenticator
This authentication service supports Derby NATIVE authentication.
To activate this service, set the derby.authentication.provider database or system property to a value beginning with the token "NATIVE:".
This service instantiates and calls the basic User authentication scheme at runtime.
User credentials are defined in the SYSUSERS table.
| Modifier and Type | Field and Description |
|---|---|
private boolean |
_authenticateDatabaseOperationsLocally |
private java.lang.String |
_badlyFormattedPasswordProperty |
private boolean |
_creatingCredentialsDB |
private java.lang.String |
_credentialsDB |
private double |
_passwordExpirationThreshold |
private long |
_passwordLifetimeMillis |
authenticationScheme, AuthenticationTrace, SECMEC_USRSSBPWDMODULE| Constructor and Description |
|---|
NativeAuthenticationServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
private boolean |
authenticateLocally(java.lang.String userName,
java.lang.String userPassword,
java.lang.String databaseName)
Authenticate the passed-in credentials against the local database.
|
private boolean |
authenticateRemotely(java.lang.String userName,
java.lang.String userPassword,
java.lang.String databaseName)
Authenticate the passed-in credentials against another Derby database.
|
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.
|
private boolean |
authenticatingInThisDatabase(java.lang.String userVisibleDatabaseName)
Return true if we are authenticating in this database.
|
private boolean |
authenticatingInThisService(java.lang.String canonicalDatabaseName)
Return true if we are authenticating in this service.
|
void |
boot(boolean create,
java.util.Properties properties)
Start this module.
|
private void |
callDataSourceSetter(javax.sql.DataSource ds,
java.lang.String methodName,
java.lang.String value)
Call a setter method on a DataSource via reflection
|
boolean |
canSupport(java.util.Properties properties)
Check if we should activate this authentication service.
|
private java.lang.String |
getCanonicalServiceName()
Get the canonical name of the current database service
|
private java.lang.String |
getCanonicalServiceName(java.lang.String rawName)
Turn a service name into its normalized, standard form
|
java.lang.String |
getSystemCredentialsDatabaseName()
Override behavior in superclass
|
private boolean |
isCredentialsService(java.lang.String canonicalDatabaseName)
Return true if the passed in service is the credentials database.
|
private void |
parseNativeSpecification(java.util.Properties properties)
Parse the specification of NATIVE authentication.
|
private boolean |
validAuthenticationProvider()
Return true if AUTHENTICATION_PROVIDER_PARAMETER was well formatted.
|
private StandardException |
wrap(java.lang.Throwable t) |
apply, authenticate, getDatabaseProperties, getDatabaseProperty, getProperty, getServiceName, getSystemProperty, getTransaction, hashPasswordSHA1Scheme, hashUsingDefaultAlgorithm, init, map, parsePasswordLifetime, parsePasswordThreshold, requireAuthentication, setAuthenticationService, stop, substitutePassword, validateprivate boolean _creatingCredentialsDB
private java.lang.String _credentialsDB
private boolean _authenticateDatabaseOperationsLocally
private long _passwordLifetimeMillis
private double _passwordExpirationThreshold
private java.lang.String _badlyFormattedPasswordProperty
public boolean canSupport(java.util.Properties properties)
canSupport in interface ModuleSupportableprivate void parseNativeSpecification(java.util.Properties properties)
Parse the specification of NATIVE authentication. It can take 3 forms:
private boolean validAuthenticationProvider()
throws StandardException
Return true if AUTHENTICATION_PROVIDER_PARAMETER was well formatted. The property must have designated some database as the authentication authority.
StandardExceptionpublic void boot(boolean create,
java.util.Properties properties)
throws StandardException
AuthenticationServiceBaseboot in interface ModuleControlboot in class AuthenticationServiceBaseStandardException - upon failure to load/boot the expected
authentication service.ModuleControl.boot(boolean, java.util.Properties)public java.lang.String getSystemCredentialsDatabaseName()
getSystemCredentialsDatabaseName in interface AuthenticationServicegetSystemCredentialsDatabaseName in class AuthenticationServiceBasepublic 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 UserAuthenticatoruserName - 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 boolean authenticatingInThisDatabase(java.lang.String userVisibleDatabaseName)
throws StandardException
Return true if we are authenticating in this database.
StandardExceptionprivate boolean authenticatingInThisService(java.lang.String canonicalDatabaseName)
throws StandardException
Return true if we are authenticating in this service.
StandardExceptionprivate boolean isCredentialsService(java.lang.String canonicalDatabaseName)
throws StandardException
Return true if the passed in service is the credentials database.
StandardExceptionprivate java.lang.String getCanonicalServiceName()
throws StandardException
StandardExceptionprivate java.lang.String getCanonicalServiceName(java.lang.String rawName)
throws StandardException
StandardExceptionprivate boolean authenticateRemotely(java.lang.String userName,
java.lang.String userPassword,
java.lang.String databaseName)
throws StandardException,
java.sql.SQLWarning
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.StandardExceptionjava.sql.SQLWarningprivate void callDataSourceSetter(javax.sql.DataSource ds,
java.lang.String methodName,
java.lang.String value)
throws StandardException
StandardExceptionprivate StandardException wrap(java.lang.Throwable t)
private boolean authenticateLocally(java.lang.String userName,
java.lang.String userPassword,
java.lang.String databaseName)
throws StandardException,
java.sql.SQLException
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.StandardExceptionjava.sql.SQLExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.