Powering next gen AI apps with Postgres 🚀 Learn More

Passwordless auth

Learn how to connect to Neon without a password

Neon's psql passwordless auth feature helps you quickly authenticate a connection to Neon without providing a password.

The following instructions require a working installation of psql, an interactive terminal for working with Postgres. For information about psql, refer to the psql reference, in the PostgreSQL Documentation.

To connect using Neon's psql passwordless auth feature:

  1. In your terminal, run the following command:

    A response similar to the following is displayed:

  2. In your browser, navigate to the provided link. Log in to Neon if you are not already logged in. You are asked to select a Neon project to connect to. If your project has more than one compute endpoint, you are also asked to select one.

    After making your selections, you are advised that you can return to your terminal or command window where information similar to the following is displayed:

    The passwordless auth feature connects to the first database created in the branch. To check the database you are connected to, issue this query:

    Switching databases from the psql prompt (using \c <database_name>, for example) after you have authenticated restarts the passwordless auth authentication process to authenticate a connection to the new database.

Running queries

After establishing a connection, try running the following queries:

The following result set is returned:

Need help?

Send a request to support@neon.tech, or join the Neon community forum.

Edit this page
Was this page helpful?