Upgrading from SCRAM-SHA-1 to SCRAM-SHA-256

Hi ,

Just wanted to ask if there is a way to upgrade or include SCRAM-SHA-256 from an existing user with only SCRAM-SHA-1 authentication mechanism , other then recreating the user id. Thanks

So did you try recreating the user with scram-sha-256 mechanism?

Hi @Daniel_Inciong,

This can be updated using the updateUser command.

use admin
db.runCommand({'updateUser':'user0',pwd:passwordPrompt(), mechanisms:['SCRAM-SHA-256']})

Although you may wish to use both SCRAM-SHA mechanisms as you switch to make sure all tools and drivers you are using can connect correctly.

In that case use: mechanisms:['SCRAM-SHA-1','SCRAM-SHA-256'] a following update could be done just specifying SCRAM-SHA-256 and that one would not need the password provided as you’d be removing a mechanism.

hi chris,

thank you for your feedback , sorry for the delayed response problem was already solved by updating the driver of the application connecting to the upgraded version.