Skip to content

Saved passwords on shared servers broken for unprivileged users #5367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fire2 opened this issue Sep 25, 2022 · 3 comments
Closed

Saved passwords on shared servers broken for unprivileged users #5367

fire2 opened this issue Sep 25, 2022 · 3 comments
Assignees
Milestone

Comments

@fire2
Copy link

fire2 commented Sep 25, 2022

On a clean installation of PgAdmin with LDAP authentication in server mode, based on the official Docker image version 6.14 I have the following issue:

  1. Add a shared server as admin. Log out.
  2. Login as an unprivileged user, set server Username under Properties > Connection.
  3. Try to connect inserting the password and saving it -> it works.
  4. Disconnect server (or logout) then re-connect to server, the following error shows:
    not enough values to unpack (expected 3, got 2)

Screenshot 2022-09-25 at 19 01 32

Logs:

 File "/pgadmin4/pgadmin/utils/driver/psycopg2/connection.py", line 240, in _decode_password                                                                                                                                                         │
│     password = password.decode()                                                                                                                                                                                                                      │
│ UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe3 in position 1: invalid continuation byte                                                                                                                                                     │
│ 2022-09-25 17:05:39,203: ERROR    pgadmin:    not enough values to unpack (expected 3, got 2)                                                                                                                                                         │
│ Traceback (most recent call last):                                                                                                                                                                                                                    │
│   File "/pgadmin4/pgadmin/browser/server_groups/servers/__init__.py", line 1411, in connect                                                                                                                                                           │
│     status, errmsg = conn.connect(                                                                                                                                                                                                                    │
│   File "/pgadmin4/pgadmin/utils/driver/psycopg2/connection.py", line 292, in connect                                                                                                                                                                  │
│     is_error, errmsg, password = self._decode_password(encpass, manager,                                                                                                                                                                              │
│ ValueError: not enough values to unpack (expected 3, got 2)                                                                                                                                                                                           │

Note: saving passwords and connecting to servers seems to work fine for the admin user (same steps as above with no error).

I have not managed to get this to work, and I wouldn't want users to have to enter the password every time. That's what the "save password" option is for. Am I missing something here? It looks like a bug.

@akshay-joshi akshay-joshi moved this to 🆕 New in Current Sprint (192) Sep 28, 2022
@yogeshmahajan-1903 yogeshmahajan-1903 moved this from 🆕 New to 🏗 In Progress in Current Sprint (192) Sep 29, 2022
akshay-joshi pushed a commit that referenced this issue Sep 30, 2022
@akshay-joshi akshay-joshi moved this from 🏗 In Progress to In Testing in Current Sprint (192) Sep 30, 2022
@akshay-joshi akshay-joshi added this to the 6.15 milestone Sep 30, 2022
@FaharAbbasRizvi
Copy link
Contributor

This is resolved in the latest snapshot build:

https://www.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/2022-10-05/

@FaharAbbasRizvi FaharAbbasRizvi moved this from In Testing to ✅ Done in Current Sprint (192) Oct 6, 2022
@dev3fyfy
Copy link

dev3fyfy commented Nov 2, 2022

This is resolved in the latest snapshot build:

https://www.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/2022-10-05/
I have same problem but this url is not found , can you send me another url to solve this problem please?

@fire2
Copy link
Author

fire2 commented Nov 2, 2022

This is included in the latest 6.15 official release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants