[Geoserver-users] User login via PostGreSQL

Greetings all,

I've only recently started working with GeoServer and have no experience
whatsoever with it and PostGreSQL.
After spending quite some time searching the web and fiddling around with
the server (running on Ubuntu), I've managed to successfully install and run
both PostGreSQL and GeoServer. However, although I can see users in the
database from the GeoServer admin panel (Users and Roles) and can add new
users, I can not login via said users.

I have taken (I believe) all the necessary steps required for it to work (on
GeoServer), like adding role and authentication services, but it still fails
to work.
I have no idea what could be wrong seeing as it does actually see and add
the users, so I am hoping somebody here can help me.

Additional information:
GeoServer 2.4.0 (planning to update once I find a way to keep current data
safe)
phpPGAdmin
Ubuntu 14.04 (VPS)

Thanks in advance!

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/User-login-via-PostGreSQL-tp5204875.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,
can you send a list of the steps you followed to setup the users? By default GeoServer uses users stored internally, not on the database. So maybe you missed some steps.

···

2015-05-08 18:39 GMT+02:00 Bahumut5 <bahumut5@anonymised.com>:

Greetings all,

I’ve only recently started working with GeoServer and have no experience
whatsoever with it and PostGreSQL.
After spending quite some time searching the web and fiddling around with
the server (running on Ubuntu), I’ve managed to successfully install and run
both PostGreSQL and GeoServer. However, although I can see users in the
database from the GeoServer admin panel (Users and Roles) and can add new
users, I can not login via said users.

I have taken (I believe) all the necessary steps required for it to work (on
GeoServer), like adding role and authentication services, but it still fails
to work.
I have no idea what could be wrong seeing as it does actually see and add
the users, so I am hoping somebody here can help me.

Additional information:
GeoServer 2.4.0 (planning to update once I find a way to keep current data
safe)
phpPGAdmin
Ubuntu 14.04 (VPS)

Thanks in advance!


View this message in context: http://osgeo-org.1560.x6.nabble.com/User-login-via-PostGreSQL-tp5204875.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Regards,
Lorenzo Natali

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

==

Dott. Ing. Lorenzo Natali
Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.

Hello and thanks for your response.

- The following steps have been taken:
On Geoserver, I've created a Group Service using the JDBC option and
connected it through localhost (jdbc:postgresql://localhost:5432/Geoserver)
using a postgresql.Driver. The Username/Password I've used in this
connection are for a superuser on the database. The "Create Database Tables"
has been enabled.

- I have added users to this database both by adding them via phppgadmin and
by using the GeoServer. Both worked and both users are seen by the
GeoServer.

- Created a new Authentication Provider using previous made Group Service
and the same connection via localhost. Added the Authentication Provider to
the Selected Provider Chain.

Tried logging in via users who were added to the Database Table. Does not
work.

The following error cause is given when trying to login via a DB user
(Username used was "DB_User_Test"): Caused by:
org.postgresql.util.PSQLException: FATAL: password authentication failed for
user "admin"

It seems that GeoServer tried to login via an Admin user. However, I didn't
define this anywhere so I am not sure why it does this.

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/User-login-via-PostGreSQL-tp5204875p5205269.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,
This sounds like an error with the authentication to postgres. So I suggest to check the following points:

  • Check the version of postgres + postgis is not too old

  • It seems to do the login to the database with user admin, check the connection parameters.

  • Use GeoServer to create users, better on a clean db, without editing the tables with pgAdmin.

···

2015-05-12 10:23 GMT+02:00 Bahumut5 <bahumut5@anonymised.com>:

Hello and thanks for your response.

  • The following steps have been taken:
    On Geoserver, I’ve created a Group Service using the JDBC option and
    connected it through localhost (jdbc:postgresql://localhost:5432/Geoserver)
    using a postgresql.Driver. The Username/Password I’ve used in this
    connection are for a superuser on the database. The “Create Database Tables”
    has been enabled.

  • I have added users to this database both by adding them via phppgadmin and
    by using the GeoServer. Both worked and both users are seen by the
    GeoServer.

  • Created a new Authentication Provider using previous made Group Service
    and the same connection via localhost. Added the Authentication Provider to
    the Selected Provider Chain.

Tried logging in via users who were added to the Database Table. Does not
work.

The following error cause is given when trying to login via a DB user
(Username used was “DB_User_Test”): Caused by:
org.postgresql.util.PSQLException: FATAL: password authentication failed for
user “admin”

It seems that GeoServer tried to login via an Admin user. However, I didn’t
define this anywhere so I am not sure why it does this.


View this message in context: http://osgeo-org.1560.x6.nabble.com/User-login-via-PostGreSQL-tp5204875p5205269.html

Sent from the GeoServer - User mailing list archive at Nabble.com.


One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Regards,
Lorenzo Natali

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

==

Dott. Ing. Lorenzo Natali
Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.

Greetings,

Sorry for the late reply, but I have been unable to reply due to
circumstances with specific servers within the company which required my
full attention.

- I have checked the version of both PostGis and PostGres, but both seem to
be up to date. I have checked if the versions work well with each other, but
everything seems to be just fine.
- This was the one thing I have been wondering about for a while now.
Unfortunately, even though I feel that it is using the wrong parameters, I
have no actual clue as to where it gets these parameters. I have browsed
through almost every single file I could fine, but non seemed to mention
anything about connection parameters or login details (besides the
users.xml).
- I have cleaned out the DB and created new users from the GeoServer (with
the ability to create tables), did not work.

Thanks for your help!
Yours sincerely,
Dré Vromans

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/User-login-via-PostGreSQL-tp5204875p5207564.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,
I configured jdbc users many times, and I didn’t find any problem, so I suppose there is a wrong configuration somewhere.
Make you sure to isolate the problem trying on service at the time. You can try creating users in the default usergroup service first, then try to add your jdbc service and check if the problem happens only with it. Check also if the users are enabled (enabled column is a char).

You can also try to increase the logging level to have more details about what is happening during the login (you can find in the “global” section).

From the configuration point of view, usergroup configuration is in the GeoServer data directory under security/usergroup/<name_of_your_usergroup>. The configuration that defines which usergroup service and which roleservice use is in the file security/config.xml. All the passwords for services are stored encrypted.
By default GeoServer uses users defined in xml files inside the directory (security/usergroup/default). When you add a usergroup it will be added after this one, and when the user do the login it makes an attempt to all the configured service in sequence. You can remove the default to be sure you are using only the yours.

You can also check the documentation to find if you missed some steps. Take a look to the whole authentication system to find where your problem can be.

http://docs.geoserver.org/2.6.x/en/user/webadmin/security/index.html

Lorenzo.

Il giorno mar 26 mag 2015 alle ore 11:50 Bahumut5 <bahumut5@anonymised.com> ha scritto:

Greetings,

Sorry for the late reply, but I have been unable to reply due to
circumstances with specific servers within the company which required my
full attention.

  • I have checked the version of both PostGis and PostGres, but both seem to
    be up to date. I have checked if the versions work well with each other, but
    everything seems to be just fine.
  • This was the one thing I have been wondering about for a while now.
    Unfortunately, even though I feel that it is using the wrong parameters, I
    have no actual clue as to where it gets these parameters. I have browsed
    through almost every single file I could fine, but non seemed to mention
    anything about connection parameters or login details (besides the
    users.xml).
  • I have cleaned out the DB and created new users from the GeoServer (with
    the ability to create tables), did not work.

Thanks for your help!
Yours sincerely,
Dré Vromans


View this message in context: http://osgeo-org.1560.x6.nabble.com/User-login-via-PostGreSQL-tp5204875p5207564.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hello!

Small update: I have finally managed to get it to work today. Here's what I
changed:

In the group service settings, at the connection URL, I used the following:
*jdbc:postgresql://localhost:5432*
This, however, did not work.

However, I changed this to also define which user it should connect with (as
it kept saying "admin" in the error log). Changing the above to this:
*jdbc:postgresql://localhost:5432/<database>?user=<username>&password=<password>*
The above works now.

So thank you all for your help and time, but it seems to be solved!

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/User-login-via-PostGreSQL-tp5204875p5207753.html
Sent from the GeoServer - User mailing list archive at Nabble.com.