[COMPASS-4430] User name not correctly stored for SCRAM based authentication Created: 30/Sep/20  Updated: 29/Oct/23  Resolved: 27/Oct/20

Status: Closed
Project: Compass
Component/s: Compass
Affects Version/s: 1.22.1
Fix Version/s: 1.24.1

Type: Bug Priority: Major - P3
Reporter: Matthew Shaylor Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 10


Story Points: 3
Documentation Changes: Not Needed
Sprint: Iteration Orange

 Description   

 

 

To reproduce:

 

1. Run up a mongo server like so:
docker run --rm -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME=mongoroot -e MONGO_INITDB_ROOT_PASSWORD=password mongo:4.2.6

2. In compass:
  New connection -> Fill in fields manually -> Authentication: SCRAM-SHA-256 -> Username: mongoroot, Password: password -> Connect

Compass should connect ok.

3. Favourite-> Enter a name -> Save
 
4. Connect -> disconnect
 
5. [The new favourite should still be selected] Paste connection string -> Connect
 
 
At this point you should see "Authentication Failed" Error.
 
In the server logs I also see: 

 

2020-09-30T16:35:28.147+0000 I ACCESS [conn104] SASL SCRAM-SHA-256 authentication failed for undefined on admin from client 172.17.0.1:35858 ; UserNotFound: Could not find user "undefined" for db "admin"

 



 Comments   
Comment by Githook User [ 26/Oct/20 ]

Author:

{'name': 'Maurizio Casimirri', 'email': 'maurizio.cas@gmail.com', 'username': 'mcasimir'}

Message: COMPASS-4430: fix connection uri not working with SCRAM-SHA-256 (#2044)
Branch: master
https://github.com/mongodb-js/compass/commit/198b8b143de325f2bfe43a509f24e88b06f0d62d

Comment by Githook User [ 26/Oct/20 ]

Author:

{'name': 'mcasimir', 'email': 'maurizio.cas@gmail.com', 'username': 'mcasimir'}

Message: COMPASS-4430: fix connection uri not working with SCRAM-SHA-256
Branch: COMPASS-4430
https://github.com/mongodb-js/compass/commit/249eff6572f5ab47b750623f1dece41d9972b120

Comment by Matthew Shaylor [ 30/Sep/20 ]

I don't appear to be able to edit the issue so excuse my poor formatting!

Basically: If you configure a SCRAM authentication based connection via "Fill in the fields manually", then save it, then attempt to switch to "Paste connection string" - you end up with strange authentication failures.

Comment by Matthew Shaylor [ 30/Sep/20 ]

I think this might be the same as COMPASS-4287

 

Generated at Wed Feb 07 22:36:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.