There is currently a check that explicitly prevents creating a SCRAM-SHA-256 user credential for newer server versions:
if v >= 7:
# Until drivers have implemented SCRAM-SHA-256, use old mechanism.
opts = {'mechanisms': ['SCRAM-SHA-1']}
Now that all official MongoDB drivers support SASL/SCRAM mechanism SCRAM-SHA-256 (see DRIVERS-439), that logic is unnecessary and results in confusing server configurations that deviate from the expected defaults.
Expected behavior
Create a new standalone deployment using MongoDB v5.0.0 with auth enabled.
There is currently a check that explicitly prevents creating a
SCRAM-SHA-256
user credential for newer server versions:Now that all official MongoDB drivers support SASL/SCRAM mechanism
SCRAM-SHA-256
(see DRIVERS-439), that logic is unnecessary and results in confusing server configurations that deviate from the expected defaults.Expected behavior
admin.system.users
collection:Expect that listed users have credentials for both
SCRAM-SHA-1
andSCRAM-SHA-256
mechanisms:Actual/current behavior
admin.system.users
collection:Listed users only have credentials for
SCRAM-SHA-1
mechanism: