Announcement Announcement Module
Collapse
No announcement yet.
where is the "standard Spring Security user data tables"? Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • where is the "standard Spring Security user data tables"?

    Hi.
    I'm a newbie to spring security.I want to store user information in database.
    In the reference document Chapter 2:
    "2.2.3. Using other Authentication Providers"

    It said I need a database containing the standard Spring Security user data tables,but how can i create theses tables? what's their name? where is the DDLs of these tables?

    waiting for your help,thank you.

  • #2
    try : http://www.acegisecurity.org/dbinit.txt
    it's an old version spring security named acegi, but it should work.

    Comment


    • #3
      That's the old version of the tables that will only work with the ACL package. If you want to use the latest version look at the contacts sample that comes with spring security and in there is a DataSourcePopulator.java file that contains all the DDL you need.

      Paul

      Comment


      • #4
        is that?

        Code:
        CREATE TABLE USERS(USERNAME VARCHAR_IGNORECASE(50) NOT NULL PRIMARY KEY,PASSWORD VARCHAR_IGNORECASE(50) NOT NULL,ENABLED BOOLEAN NOT NULL);
        CREATE TABLE AUTHORITIES(USERNAME VARCHAR_IGNORECASE(50) NOT NULL,AUTHORITY VARCHAR_IGNORECASE(50) NOT NULL,CONSTRAINT FK_AUTHORITIES_USERS FOREIGN KEY(USERNAME) REFERENCES USERS(USERNAME));
        CREATE UNIQUE INDEX IX_AUTH_USERNAME ON AUTHORITIES(USERNAME,AUTHORITY);

        Comment


        • #5
          i'm sure that is the one, you could go to org.springframwork.jdbc.datasouce.drivermanagerdat asource decompile the class file. then check the sql there, it's pretty much the same. hope it helps

          Comment


          • #6
            The data is the same as used by the JdbcDaoImpl class:
            Code:
                public static final String DEF_USERS_BY_USERNAME_QUERY =
                        "SELECT username,password,enabled " +
                        "FROM users " +
                        "WHERE username = ?";
                public static final String DEF_AUTHORITIES_BY_USERNAME_QUERY =
                        "SELECT username,authority " +
                        "FROM authorities " +
                        "WHERE username = ?";

            Comment

            Working...
            X