Package org.eclipse.jetty.security
Class JDBCLoginService
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.security.AbstractLoginService
-
- org.eclipse.jetty.security.JDBCLoginService
-
- All Implemented Interfaces:
LoginService
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
@Deprecated(since="2021-05-27") public class JDBCLoginService extends AbstractLoginService
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.HashMapped User Realm with JDBC as data source. TheAbstractLoginService.login(String, Object, ServletRequest)
method checks the inherited Map for the user. If the user is not found, it will fetch details from the database and populate the inherited Map. It then calls the superclassAbstractLoginService.login(String, Object, ServletRequest)
method to perform the actual authentication. Periodically (controlled by configuration parameter), internal hashes are cleared. Caching can be disabled by setting cache refresh interval to zero. Uses one database connection that is initialized at startup. Reconnect on failures.An example properties file for configuration is in
${jetty.home}/etc/jdbcRealm.properties
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
JDBCLoginService.JDBCUserPrincipal
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.-
Nested classes/interfaces inherited from class org.eclipse.jetty.security.AbstractLoginService
AbstractLoginService.RolePrincipal, AbstractLoginService.UserPrincipal
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Constructor Summary
Constructors Constructor Description JDBCLoginService()
Deprecated.JDBCLoginService(java.lang.String name)
Deprecated.JDBCLoginService(java.lang.String name, java.lang.String config)
Deprecated.JDBCLoginService(java.lang.String name, IdentityService identityService, java.lang.String config)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
connectDatabase()
Deprecated.(re)Connect to database with parameters setup by loadConfig()java.lang.String
getConfig()
Deprecated.java.lang.String[]
loadRoleInfo(AbstractLoginService.UserPrincipal user)
Deprecated.AbstractLoginService.UserPrincipal
loadUserInfo(java.lang.String username)
Deprecated.void
setConfig(java.lang.String config)
Deprecated.Load JDBC connection configuration from properties file.-
Methods inherited from class org.eclipse.jetty.security.AbstractLoginService
getIdentityService, getName, isFullValidate, login, logout, setFullValidate, setIdentityService, setName, toString, validate
-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, unmanage, updateBean, updateBean, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
-
-
-
Constructor Detail
-
JDBCLoginService
public JDBCLoginService() throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
JDBCLoginService
public JDBCLoginService(java.lang.String name) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
JDBCLoginService
public JDBCLoginService(java.lang.String name, java.lang.String config) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
JDBCLoginService
public JDBCLoginService(java.lang.String name, IdentityService identityService, java.lang.String config) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
-
Method Detail
-
getConfig
public java.lang.String getConfig()
Deprecated.
-
setConfig
public void setConfig(java.lang.String config)
Deprecated.Load JDBC connection configuration from properties file.- Parameters:
config
- Filename or url of user properties file.
-
connectDatabase
public void connectDatabase()
Deprecated.(re)Connect to database with parameters setup by loadConfig()
-
loadUserInfo
public AbstractLoginService.UserPrincipal loadUserInfo(java.lang.String username)
Deprecated.
-
loadRoleInfo
public java.lang.String[] loadRoleInfo(AbstractLoginService.UserPrincipal user)
Deprecated.
-
-