edgedb-js
edgedb-js copied to clipboard
[Help-wanted] SCRAM-SHA-256 Authentication Failed.
Hi,
I am trying to connect to the edgeDB instance, but the connection fails Authentication Failed.
I have a windows system and have installed edgedb by docker. Following is the command that was used to spawn an edgedb instance.
edgedb server init test2 --port 5658 --default-user edgedb --default-database edgedb

Now I tried to connect to this instance using js binding but failed with an error authentication failure. The authentication method used here is SHA-SCRAM-256.
The js-binding is able to send ClientFinal message which is AuthenticationSASLResponse here. Following is the stack trace from the server.
value=Traceback (most recent call last):
File "edb/server/protocol/binary.pyx", line 1615, in edb.server.protocol.binary.EdgeConnection.main
File "edb/server/protocol/binary.pyx", line 387, in auth
File "edb/server/protocol/binary.pyx", line 643, in _auth_scram
edb.errors.AuthenticationError: authentication failed
The usecase here is that I am trying to add the SCRAM-SHA-256 authentication to Java binding. Please help.
Also, I observed that even though we provide the --port parameter while initiating an instance, it does not reflect. In the given example, the port parameter passed is 5658 and the instance is spawned on 10703. It uses the next available port starting from 10700. Docker internal port is always 5656, thus could not understand the use of --port param.
Are you trying to connect with the instance name or some other way (like with a dsn or options object)?
edgedb server init generates a random password for the default user (edgedb) on the instance it creates, and stores it in the credentials file (C:\Users\suryas3\.edgedb\credentials\test2.json in the output above), which the js binding then reads if you give the name of the instance to the connect call. eg. const conn = await edgedb.connect('test2'). If you are connecting another way it will fail unless you give the password from the credentials file as well as the host/port/user/etc.