Geoserver + authkey database issues

Hi, I am trying to setup authkey according to this Key authentication module — GeoServer 2.28.0 User Manual

I am having and issue after setting the users with this manual because some database fields seem to be missing.

org.apache.wicket.WicketRuntimeException: java.io.IOException: org.postgresql.util.PSQLException: ERROR: relation "user_roles" does not exist Position: 33 at org.geoserver.security.web.user.AbstractUserPage.<init>(AbstractUserPage.java:116)

The only mention of those tables is in this file from geostore geostore/geoserver/role/geostore/postgres/rolesddl.xml at master · geosolutions-it/geostore · GitHub, am I missing something? I might create the tables according to this schema but its seems that this should be at 002_create_schema_postgres.sql or have some detail in the documentation.

Any help welcomed

Starting from the xml I created the missing tables, the script is now the followin (so far it seems to work)

create table roles(name varchar(64) not null,parent varchar(64),  primary key(name));
create table role_props(rolename varchar(64) not null,propname varchar(64) not null, propvalue varchar(2048),primary key (rolename,propname));
create table user_roles(username varchar(128) not null, rolename varchar(64) not null,  primary key(username,rolename));
create index user_roles_idx on user_roles(rolename,username);
create table group_roles(groupname varchar(128) not null, rolename varchar(64) not null,  primary key(groupname,rolename));
create index group_roles_idx on group_roles(rolename,groupname);
GRANT TRUNCATE, MAINTAIN, SELECT, UPDATE, REFERENCES, TRIGGER, INSERT, DELETE ON TABLE geostore.roles TO geostore;
GRANT TRUNCATE, MAINTAIN, SELECT, UPDATE, REFERENCES, TRIGGER, INSERT, DELETE ON TABLE geostore.role_props TO geostore;
GRANT TRUNCATE, MAINTAIN, SELECT, UPDATE, REFERENCES, TRIGGER, INSERT, DELETE ON TABLE geostore.user_roles TO geostore;
GRANT TRUNCATE, MAINTAIN, SELECT, UPDATE, REFERENCES, TRIGGER, INSERT, DELETE ON TABLE geostore.group_roles TO geostore;

Hi @aseques

I think you should separate the 2 auth issues, I believe you want to focus on new JDBC user/group service, and especially note the option Create database tables

Docs:

Peter

HI Peter, you might be right, I was hesitant about this option because of the text “Database Initalization” I though that it might initalize the database, also the mention in this guide (here)

This example will focus on PostgreSQL database type I am assuming this is a new installation, so no existing user or map will be preserved

So far the webservice has started, I am currently evaluating if it can be used the way I wanted, but I’ll open another post for this.

Thanks for your help

1 Like