JDBC Authentication ProviderΒΆ

The JDBC Authentication Provider uses database users to authenticate. It basically tries to connect to a JDBC url, with the given credentials, authenticating the user if the connection can be estabilished. A user/group service is used to bind information to the user once it is authenticated.

To configure the provider you have to specify:
  • a name for the provider
  • choose one of the available user/group service
  • the JDBC driver class name used to connect to the database (one of the drivers available in GeoServer installation)
  • the JDBC connection url for the database

We are going to configure a new JDBC Authentication provider, but first we need to create a new user/group service. Look at User/group service page to see how to create it. When you have the service configured, go on and:

  1. From the Welcome page click the Authentication link on the Menu Security section.

  2. Click Add new in the Authentication Providers menu

  3. Click JDBC in the Authentication Providers list

    • Insert testdb in the Name text field.
    • Select jdbcservice from User/Group service combo box.
    • Select org.postgresql.Driver from Driver class name combo box.
    • Insert jdbc:postgresql://localhost:5434/postgis20 in the Connection URL text field.
    ../_images/jdbcprov1.png
  4. Click the Save button.

  5. From the Welcome page click the Authentication link on the Menu Security section.

  6. Select the testdb element in the Available list of the Provider Chain menu

  7. Click the arrow right button to add the element to the Selected list

  8. Click the Save button.

Now, we have activated the new Authentication provider, having a new administrator user, named postgres. To verify it:

  1. Click the Logout button on the top right part of the page.
  2. Insert postgres in the Username and Password text fields on the top right part of the page.
  3. Click the Login button on the top right part of the page.

You should be now logged in with the postgres user, with administrative rights.