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_USRSSBPWD
MODULE
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.
|
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
|
private static ModuleFactory |
getMonitor()
Privileged Monitor lookup.
|
private static java.lang.String |
getServiceName(java.lang.Object serviceModule)
Privileged Monitor lookup.
|
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, getServiceModule, getServiceName, getSystemProperty, getTransaction, hashPasswordSHA1Scheme, hashUsingDefaultAlgorithm, init, map, parsePasswordLifetime, parsePasswordThreshold, requireAuthentication, setAuthenticationService, stop, substitutePassword, validate
private 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 ModuleSupportable
private 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.
StandardException
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 java.lang.String getSystemCredentialsDatabaseName()
getSystemCredentialsDatabaseName
in interface AuthenticationService
getSystemCredentialsDatabaseName
in class AuthenticationServiceBase
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 boolean authenticatingInThisDatabase(java.lang.String userVisibleDatabaseName) throws StandardException
Return true if we are authenticating in this database.
StandardException
private boolean authenticatingInThisService(java.lang.String canonicalDatabaseName) throws StandardException
Return true if we are authenticating in this service.
StandardException
private boolean isCredentialsService(java.lang.String canonicalDatabaseName) throws StandardException
Return true if the passed in service is the credentials database.
StandardException
private java.lang.String getCanonicalServiceName() throws StandardException
StandardException
private java.lang.String getCanonicalServiceName(java.lang.String rawName) throws StandardException
StandardException
private 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.StandardException
java.sql.SQLWarning
private 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.StandardException
java.sql.SQLException
private static ModuleFactory getMonitor()
private static java.lang.String getServiceName(java.lang.Object serviceModule)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.