Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

In this section we will focus on the use a database for verifying and retrieving user names and passwords.

...

  • In the Console Navigation menu on the left click on DB Manager.
  • Enter SecurityDatabase in the Create DB: field and click Create.
  • Select the SecurityDatabase database from the Use DB: pull-down menu, enter the following commands and click Run SQL. Code Block create table users(username varchar(15), password varchar(15)); create table groups(username varchar(15), groupname varchar(15)); insert into users values('userone','p1'); insert into users values('usertwo','p2'); insert into users values('userthree','p3'); insert into groups values('userone','admin'); insert into groups values('usertwo','admin'); insert into groups values('userthree','user');

Create connection pool

  • In the Console Navigation menu on the left click on Database Pools.
  • Click on Using the Geronimo database pool wizard.
  • Enter SecurityDatabasePool as the database pool name.
  • Select Derby embedded XA from the database pool type pull-down menu and click Next.
  • From the Driver JAR scroll box select org.apache.geronimo.configs/system-database/2.1.1-SNAPSHOT/car.
  • Leave blank the DB user name and password.
  • Enter SecurityDatabase as the database name.
  • Click Deploy.

...

Now you have a new, fully configured, security realm that retrieves user names and passwords from the build in Derby database.

...

...

If you get an error the first time you try to validate this realm, you will very likely see the SQL Exception: Failed to start database ... error in the terminal and logs. This is a know issue with Derby, you will need to restart Geronimio so the new database can communicate properly.

...

The following example shows the deployment plan for this security realm. As an alternative to the Geronimo Administration Console, you can save this example to a file (i.e. derby_security_realm.xml) and deploy it with the Deployer tool by running the following command:

...

...

Once the security realm has been created, you can use the usage link to view samples of how to use the new realm in your applications.