1

I am using kUbuntu 18.04(bionic) on my local machine and I installed postgresql11 and pgadmin4 step by step from this guide https://wiki.postgresql.org/wiki/Apt. And when i start pgAdmin4 firefox gives me this message:

Unauthorized

The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.

Can someone tell me what I did wrong or what else should I configure

2
  • Did you authorize access from other than localhost (127.0.0.1)? Commented Apr 17, 2019 at 14:27
  • No I didn't. I just installed it and run it Commented Apr 17, 2019 at 14:36

2 Answers 2

4

What is happening is that when you start it and opens your browser, the ?key=xxx is lost. I copied mine from the startup log file in:

~/.pgAdmin4.startup.log

It should look something like this:

http://127.0.0.1:38485/?key=f687289c-62ca-4d64-a425-1b45ccee83d5
1
  • 1
    This worked for me! Visualizing the "~/.pgAdmin4.startup.log" file provides the port number and the key.
    – Irene
    Commented Jul 21, 2020 at 8:16
0
  1. In postgresql.conf add listen_addresses = '*' on the last line.

  2. In /var/lib/pgsql/data/pg_hba.conf add a new line:

    host all all YOUR_IP_ADDRESS/32 md5  
    
  3. Restart the service:

    sudo service postgresql restart
    
5
  • Still doesn't work Commented Apr 17, 2019 at 16:00
  • Can the problem be between the pgadmin server and the browser(browser doesn't give key to the web server of the pgAdmin) and then triggers this reaction Commented Apr 18, 2019 at 15:08
  • Is pgAdmin4 deployed in a server mode? Commented Apr 18, 2019 at 15:17
  • Yes, I think so. I have windows 10 and installed it there too. When I run the Icon of pgAddmin4, it opens the browser and in the address bar it puts some key(I don't know where is configured "127.0.0.1:51138/?key=5ab2d258-7b31-411c-80f0-4137ad5d0e5f") and it works peferctly fine. Commented Apr 19, 2019 at 9:13
  • So, you are not getting the unauthorized error anymore? Commented Apr 24, 2019 at 3:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .