diff --git a/core/src/main/java/org/springframework/security/userdetails/jdbc/JdbcDaoImpl.java b/core/src/main/java/org/springframework/security/userdetails/jdbc/JdbcDaoImpl.java index d46e6fb5b7..ecbf82286f 100644 --- a/core/src/main/java/org/springframework/security/userdetails/jdbc/JdbcDaoImpl.java +++ b/core/src/main/java/org/springframework/security/userdetails/jdbc/JdbcDaoImpl.java @@ -47,23 +47,53 @@ import javax.sql.DataSource; /** - * Retrieves user details (username, password, enabled flag, and authorities) from a JDBC location. + * UserDetailsServiceRetrieves implementation which retrieves the user details + * (username, password, enabled flag, and authorities) from a database using JDBC queries. + * + *
| Column |
|---|
| username |
| password |
| enabled |
| Column |
|---|
| username |
| authority |
- * A default database structure is assumed, (see {@link #DEF_USERS_BY_USERNAME_QUERY} and {@link - * #DEF_AUTHORITIES_BY_USERNAME_QUERY}, which most users of this class will need to override, if using an existing - * scheme. This may be done by setting the default query strings used. - *
- * In order to minimise backward compatibility issues, this DAO does not recognise the expiration of user + * In order to minimise backward compatibility issues, this implementation doesn't recognise the expiration of user * accounts or the expiration of user credentials. However, it does recognise and honour the user enabled/disabled - * column. - *
+ * column. This should map to a boolean type in the result set (the SQL type will depend on the + * database you are using). All the other columns map to Strings. + * + *
+ * When groups are being used, the tables "groups", "group_members" and "group_authorities" are used. See + * {@link #DEF_GROUP_AUTHORITIES_BY_USERNAME_QUERY} for the default query which is used to load the group authorities. + * Again you can customize this by setting the groupAuthoritiesByUsernameQuery property, but the format of + * the rows returned should match the default. * * @author Ben Alex * @author colin sampaleanu