Skip to content

Connection dialog rejects passwords over 1024 characters, breaking Entra access tokens used as password (regression in 1.34.0) #331

Open

Description

@irisdc

Describe the bug

The connection dialog rejects passwords longer than 1024 characters ("Must not exceed 1024 characters."). Microsoft Entra access tokens for Azure Database for PostgreSQL (for example from a managed identity) are about 1,500 characters long, so they can no longer be used as the password. This works in extension version 1.32.1 and fails in 1.34.0.

To Reproduce

Steps to reproduce the behavior:

  1. Get an Entra access token for https://ossrdbms-aad.database.windows.net/.default (for example from a managed identity).
  2. Open a new connection and set Authentication type to Password.
  3. Paste the token as the password.
  4. See the error "Must not exceed 1024 characters." under the Password field.

Expected behavior

The password is accepted and the connection can be saved, as in 1.32.1. Suggested fix: raise the limit (Entra access tokens can be several KB) or skip the length check for passwords.

Screenshots

(paste the screenshot of the Password field here)

VS Code version

1.128.0 (commit fc3def6774c76082adf699d366f31a557ce5573f), x64. Remote session on Linux 6.8.0-1030-azure (Azure ML compute instance). Extension: ms-ossdata.vscode-pgsql 1.34.0 (1.32.1 is not affected).

Extension Logs

Not applicable: the validation error appears in the connection dialog before any connection attempt.

Activity

  1. mmcfarland commented on Nov 13, 2026

    @mmcfarland
    Member

    irisdc thanks for this report. We'll look into raising the limit for password inputs. In the meantime, for this use case, can you use the integrated Entra authentication method? I assume when you generate the token, you must regenerate and update the password regularly. Using the integration will auto-renew.

    I'm assuming that's an intentional choice, so curious about your use case or if the integration isn't working for you.

    In the meantime, please stay on 1.32.1 while we look into this.

  2. thomas-3n commented on Nov 13, 2026

    @thomas-3n

    Hello Matt McFarland (@mmcfarland), I work with irisdc, the reason why Entra ID authentication doesn't work for us is as follows:

    The "Entra Auth" setting of the extension seems to only allow the use of user accounts.

    For technical/company reasons, user accounts are not used to connect to Azure PostgreSQL servers. So, to access Azure PostgreSQL servers, our regular flow is:

    1. The developer triggers a CI/CD pipeline that generates a token using a service principal or a user-assigned managed identity and places the token in an Azure Key Vault (developer has access to the Azure Key Vault and the team lead must approve the workflow run).
    2. The developer fetches the new/fresh token in the Azure Key Vault and copy/pastes the token in the extension as a regular password.

    Process must be repeated when the token has expired (basically, it's a way to make sure developers don't have permanent access to the DB, which can potentially contain sensitive/PII data).

    I hope this clarifies the need for support for long password 😉

  3. mmcfarland commented on Nov 13, 2026

    @mmcfarland
    Member

    Thanks for the explanation! The limit we chose was arbitrary, but we do need to have input length verification. There shouldn't be a reason not to have the limit be inclusive of a token length though. I'll verify that, and follow up here. Best case scenario is we would include this in the next pre-release, likey next week.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions