Обсуждение: 401 Unauthorized on first run of pgadmin4

Поиск
Список
Период
Сортировка

401 Unauthorized on first run of pgadmin4

От
John Little
Дата:
I've today tried to install pgadmin4 on Kubuntu 18.04 according to the
instructions at

https://wiki.postgresql.org/wiki/Apt

Running pgadmin4 produces a 401 Unauthorized page in firefox.

In the terminal it shows

Python path:  "/usr/lib/python3/dist-packages"
Python Home:  ""
Webapp path:  "/usr/share/pgadmin4/web/pgAdmin4.py"

and hangs.  postgresql works fine, installed yesterday from the Ubuntu
repository.

I've tried removing ~/.pgadmin/pgadmin4.db, installing the packages
pgadmin4-apache2 and python3-flask-babelex, setting SERVER_MODE=True
and False, and resetting the postgres password.

I've never had pgadmin running before, and it's a vanilla install.  Or
at least it was until my various efforts to make it run, having
googled around.

What am I missing?

Regards, John Little


Re: 401 Unauthorized on first run of pgadmin4

От
Khushboo Vashi
Дата:


On Fri, Jul 13, 2018 at 9:37 AM, John Little <john.b.little@gmail.com> wrote:
I've today tried to install pgadmin4 on Kubuntu 18.04 according to the
instructions at

https://wiki.postgresql.org/wiki/Apt

Running pgadmin4 produces a 401 Unauthorized page in firefox.

By using the pgAdmin 4 Tray Icon, you can browse pgAdmin 4 in the default browser.
If you want to change the browser, use configure option from the pgAdmin 4 Tray icon.
To set Firefox as a default browser for pgAdmin then provide the command as below

"<Path to firefox>" %URL%

Example: "/usr/bin/firefox" %URL% 

In the terminal it shows

Python path:  "/usr/lib/python3/dist-packages"
Python Home:  ""
Webapp path:  "/usr/share/pgadmin4/web/pgAdmin4.py"

and hangs.  postgresql works fine, installed yesterday from the Ubuntu
repository.

I've tried removing ~/.pgadmin/pgadmin4.db, installing the packages
pgadmin4-apache2 and python3-flask-babelex, setting SERVER_MODE=True
and False, and resetting the postgres password.

I've never had pgadmin running before, and it's a vanilla install.  Or
at least it was until my various efforts to make it run, having
googled around.

What am I missing?

Regards, John Little


Re: 401 Unauthorized on first run of pgadmin4

От
Dave Page
Дата:


On Fri, Jul 13, 2018 at 5:27 AM, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:


On Fri, Jul 13, 2018 at 9:37 AM, John Little <john.b.little@gmail.com> wrote:
I've today tried to install pgadmin4 on Kubuntu 18.04 according to the
instructions at

https://wiki.postgresql.org/wiki/Apt

Running pgadmin4 produces a 401 Unauthorized page in firefox.

By using the pgAdmin 4 Tray Icon, you can browse pgAdmin 4 in the default browser.
If you want to change the browser, use configure option from the pgAdmin 4 Tray icon.
To set Firefox as a default browser for pgAdmin then provide the command as below

"<Path to firefox>" %URL%

Example: "/usr/bin/firefox" %URL%

Yeah - you can expect to see 401's if you're running pgAdmin in desktop mode, and try to connect without using the security key. Running under the runtime as Khushboo suggests should prevent that happening.

In server mode, you should always be redirected to the login page if you need to authenticate (and the security key isn't used). 

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: 401 Unauthorized on first run of pgadmin4

От
John Little
Дата:
On 13 July 2018 at 16:27, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> use configure option from the pgAdmin 4
> Tray icon.
> To set Firefox as a default browser for pgAdmin then provide the command as
> below
>
> "<Path to firefox>" %URL%
>
> Example: "/usr/bin/firefox" %URL%

Thank you, that worked.  I don't understand, firefox is my default
(and only) browser.  Nor do I understand why this hasn't affected more
users, and so Google would have helped me; I'd have thought there'd be
many "desktop deployments" on Ubuntu just like mine.

Regards, John Little


Re: 401 Unauthorized on first run of pgadmin4 [SEC=UNCLASSIFIED]

От
rohan.parkes@dpc.vic.gov.au
Дата:
I'm also experiencing this issue using Internet Explorer 11 (which I have to use) on Windows 7.

When I launch pgAdmin, I always get an error message saying

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.

Launching it a second time usually (but not always) clears the problem.


Rohan Parkes
Melbourne
Australia



From:        John Little <john.b.little@gmail.com>
To:        pgadmin-support@lists.postgresql.org,
Date:        13/07/2018 08:37 PM
Subject:        Re: 401 Unauthorized on first run of pgadmin4




On 13 July 2018 at 16:27, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> use configure option from the pgAdmin 4
> Tray icon.
> To set Firefox as a default browser for pgAdmin then provide the command as
> below
>
> "<Path to firefox>" %URL%
>
> Example: "/usr/bin/firefox" %URL%

Thank you, that worked.  I don't understand, firefox is my default
(and only) browser.  Nor do I understand why this hasn't affected more
users, and so Google would have helped me; I'd have thought there'd be
many "desktop deployments" on Ubuntu just like mine.

Regards, John Little



Please consider the environment before printing this email
Notice: This email and any attachments may be confidential and may contain
copyright or privileged material. You must not copy, disclose, distribute, store
or otherwise use this material without permission. Any personal information in
this email must be handled in accordance with the Privacy and Data Protection Act
2014 (Vic) and applicable laws. If you are not the intended recipient, please
notify the sender immediately and destroy all copies of this email and any
attachments. Unless otherwise stated, this email and any attachment do not
represent government policy or constitute official government correspondence. The
State does not accept liability in connection with computer viruses, data
corruption, delay, interruption, unauthorised access or use.

Re: 401 Unauthorized on first run of pgadmin4 [SEC=UNCLASSIFIED]

От
Khushboo Vashi
Дата:
Hi,

Whenever you launch pgAdmin 4 in runtime mode, it will open in your system's default browser. If you want to open the application in another browser then you can set that with pgAdmin 4 Tray Icon > Configure window.

Regarding the Unauthorised error, as Dave said in the same email thread :

You can expect to see 401's if you're running pgAdmin in desktop mode, and try to connect without using the security key. Running under the runtime should prevent that happening.
In server mode, you should always be redirected to the login page if you need to authenticate (and the security key isn't used).

Thanks,
Khushboo

On Mon, Jul 16, 2018 at 7:28 AM, <rohan.parkes@dpc.vic.gov.au> wrote:
I'm also experiencing this issue using Internet Explorer 11 (which I have to use) on Windows 7.

When I launch pgAdmin, I always get an error message saying

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.

Launching it a second time usually (but not always) clears the problem.


Rohan Parkes
Melbourne
Australia



From:        John Little <john.b.little@gmail.com>
To:        pgadmin-support@lists.postgresql.org,
Date:        13/07/2018 08:37 PM
Subject:        Re: 401 Unauthorized on first run of pgadmin4




On 13 July 2018 at 16:27, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> use configure option from the pgAdmin 4
> Tray icon.
> To set Firefox as a default browser for pgAdmin then provide the command as
> below
>
> "<Path to firefox>" %URL%
>
> Example: "/usr/bin/firefox" %URL%

Thank you, that worked.  I don't understand, firefox is my default
(and only) browser.  Nor do I understand why this hasn't affected more
users, and so Google would have helped me; I'd have thought there'd be
many "desktop deployments" on Ubuntu just like mine.

Regards, John Little



Please consider the environment before printing this email
Notice: This email and any attachments may be confidential and may contain
copyright or privileged material. You must not copy, disclose, distribute, store
or otherwise use this material without permission. Any personal information in
this email must be handled in accordance with the Privacy and Data Protection Act
2014 (Vic) and applicable laws. If you are not the intended recipient, please
notify the sender immediately and destroy all copies of this email and any
attachments. Unless otherwise stated, this email and any attachment do not
represent government policy or constitute official government correspondence. The
State does not accept liability in connection with computer viruses, data
corruption, delay, interruption, unauthorised access or use.