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:
From the Welcome page click the Authentication link on the Menu Security section.
Click Add new in the Authentication Providers menu
Click JDBC in the Authentication Providers list and complete fields as follows:
- Insert
testdb
in theName
text field. - Select
jdbcservice
fromUser/Group service
combo box. - Select
org.postgresql.Driver
fromDriver class name
combo box. - Insert
jdbc:postgresql://localhost:5434/postgis20
in theConnection URL
text field.
- Insert
Click the Save button.
From the Welcome page click the Authentication link on the Menu Security section.
Select the testdb element in the Available list of the Provider Chain menu
Click the arrow right button to add the element to the Selected list
Click the Save button.
Now, we have activated the new Authentication provider, having a new administrator user, named postgres. To verify it:
- Click the Logout button on the top right part of the page.
- Insert
postgres
in theUsername
andPassword
text fields on the top right part of the page. - 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.