pg4admin 401 Unauthorized Error

╄→尐↘猪︶ㄣ 提交于 2021-01-21 06:14:48

问题


I just installed the desktop version of pg4admin after having difficulty running it using my prior install. I used the following installing documentation to pull this off.

However, when I run the pgadmin4 service, the page gives my the following error:

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.

Also, on the terminal I'm getting the following exception:

Starting pgAdmin 4. Please navigate to http://localhost:5050 in your browser.
2016-11-01 01:14:41,981: ERROR	pgadmin:	The desktop user pgadmin4@pgadmin.org was not found in the configuration database.
2016-11-01 01:14:42,004: ERROR	pgadmin:	The desktop user pgadmin4@pgadmin.org was not found in the configuration database.
2016-11-01 01:18:45,650: ERROR	pgadmin:	The desktop user pgadmin4@pgadmin.org was not found in the configuration database.
2016-11-01 01:18:45,664: ERROR	pgadmin:	The desktop user pgadmin4@pgadmin.org was not found in the configuration database.

Did I miss anything in the install process? What can I do to fix this issue?


回答1:


In my case the problem is Internet Explorer Enhanced Security Configuration (IE ESC) (btw my OS is Windows Server 2012 R2)

Go to Server Manager, choose Local Server from the left pane. On the right pane, there is "IE Enhanced Security Configuration", the status is "on".
Click on that On, choose Off (I turned off for both the Administrators and Users, I guess one of them should be enough but I was not sure which one).
Click OK, then click the refresh button on top (or close the server manager). Refresh the pg admin4 page (or if that does not work, right click on pg Admin4 system tray icon, then choose "New PgAdmin4 window").




回答2:


Delete "pgadmin4.db" file & start pgAdmin4 again.

Linux:

~/.pgadmin/pgadmin4.db

Windows:

%appdata%\pgAdmin\pgadmin4.db

Note: You will lose all of your saved server listing from your previous install.




回答3:


in linux ubuntu 16.04 copy the adress in the file ~/.pgAdmin4.14570597673959349582.addr into your browser window. Looks like it contains the key.




回答4:


Following is working for me (using SolydK):

  • right click on "tray icon"
  • select "Configure"
  • set "Browser Command" (e.g. "/usr/bin/firefox" %URL%)



回答5:


@Leonard AB
Thanks for the solution. Worked for me. After confirming that was the issue rather than leave IE Enhanced Security Configuration off I white listed http://127.0.0.1.

Within IE:

  1. Click on the Cog and the top right of the browser or go to Internet Options via Control Panel
  2. Click on the Security tab and select Trusted sites in the zone box and then click on the Sites button
  3. Add http://127.0.0.1 to the list and hit close, finally hit ok and confirm it works

Apologies for not adding this as a comment to your post but I don't have a high enough rep.




回答6:


I solved by right clicking on tray icon, settings and changing the URL field to

/usr/bin/firefox "%URL%"

Found it on https://askubuntu.com/questions/1186036/pgadmin4-401-unauthorized-in-ubuntu-18-04




回答7:


Web-based Pgadmin application uses cookies to store its information.pgAdmin mainly stores 3 cookies namely

  • PGADMIN_KEY
  • PGADMIN_LANGUAGE
  • pga4_session

So, to use the pgAdmin application you must have to enable your browser cookies so that these 3 cookies will stored in your browser.

In Chrome

  • On your computer, open Chrome.
  • At the top right, click More and then Settings.
  • At the bottom, click Advanced.
  • Under "Privacy and security," click Site settings.
  • Click Cookies.
  • There click on "Block" toggle button then we will be switched to "Allow sites to save and read cookie data."

Then try to open pdadmin4 and you will get your pgAdmin4 home screen.




回答8:


Not an answer but a workaround

I solved it installing the pgadmin4-apache2 package and visiting the http://localhost/pgAdmin4 URL




回答9:


With pgAdmin 4 v4.28 and Windows a new behavior has appeared and authentification dialog never open in the browser when you load the program. To fix this change the registry key at HKEY_CLASSES_ROOT\.js\Content Type from text/plain to text/javascript as describe in the FAQ.




回答10:


In my case, just adding/setting the environment variable SERVER_MODE=True it worked well.




回答11:


For Windows, another option. Tray icon, right click and select "new pgAdmin window..." and in my case used Yandex.browser




回答12:


it's simple , just delete file pgadmin from C:\Program Files (x86)\pgAdmin 4 , and C:\Users\acer\AppData\Roaming\pgAdmin , delete the files , all of it , and install it again



来源:https://stackoverflow.com/questions/40354551/pg4admin-401-unauthorized-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!